Add Qt Test runner and Windows CI build

Provide a single qmake test executable with named Qt Test cases and a standard make check entry point. Cover object-history compaction, cancellation, merging, and property-key comparisons with checks that remain active in release builds, and document how to add tests.

Build and run the tests in Linux and macOS CI and add a Windows x64 job using MSVC 2022 and Qt 6. Enable pull request and manual runs alongside master pushes, preserve JUnit reports on failures, and update existing checkout and cache actions.

Validation: macOS Qt 6.10 release tests and actionlint passed. Confirmed a failing assertion produces a nonzero check result and a JUnit failure.

Closes #1050
This commit is contained in:
Leonardo Zide committed 2026-10-21 11:32:32 -07:00
1 parent 851eecee50
commit b3816caadb
6 files changed
+427 -3

No files matched your search

+82 -3
View File
@@ -1,6 +1,9 @@
name: LeoCAD CI
on:
pull_request:
branches: [ "master" ]
workflow_dispatch:
push:
branches: [ "master" ]
@@ -24,18 +27,36 @@ jobs:
run: qmake PREFIX=/usr
- name: Build
run: make -j ${{ steps.cpu-cores.outputs.count }}
- name: Generate test Makefile
run: |
mkdir -p build/tests
cd build/tests
qmake ../../tests/tests.pro CONFIG+=release CONFIG-=debug
- name: Build tests
working-directory: build/tests
run: make -j ${{ steps.cpu-cores.outputs.count }}
- name: Run tests
working-directory: build/tests
run: make check TESTARGS="-o test-results.xml,junitxml -o -,txt"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ runner.os }}
path: build/tests/test-results.xml
if-no-files-found: ignore
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.11.*'
cache: 'true'
- name: Cache Library
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-library
with:
path: library.bin
@@ -46,7 +67,7 @@ jobs:
wget https://github.com/leozide/leocad/releases/download/v26.09/Library-26.08.zip -O library.zip
unzip library.zip
- name: Cache POV-Ray
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-povray
with:
path: povray
@@ -66,3 +87,61 @@ jobs:
run: qmake -early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib PREFIX=/usr
- name: Build
run: make -j ${{ steps.cpu-cores.outputs.count }}
- name: Generate test Makefile
run: |
mkdir -p build/tests
cd build/tests
qmake ../../tests/tests.pro CONFIG+=release CONFIG-=debug
- name: Build tests
working-directory: build/tests
run: make -j ${{ steps.cpu-cores.outputs.count }}
- name: Run tests
working-directory: build/tests
run: make check TESTARGS="-o test-results.xml,junitxml -o -,txt"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ runner.os }}
path: build/tests/test-results.xml
if-no-files-found: ignore
build-windows:
runs-on: windows-2022
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.11.*'
arch: 'win64_msvc2022_64'
cache: 'true'
- name: Generate Makefile
run: qmake -spec win32-msvc CONFIG+=release CONFIG-=debug CONFIG-=debug_and_release
- name: Build
run: nmake /NOLOGO
- name: Generate test Makefile
run: |
mkdir build\tests
cd build\tests
qmake ..\..\tests\tests.pro -spec win32-msvc CONFIG+=release CONFIG-=debug CONFIG-=debug_and_release
- name: Build tests
working-directory: build/tests
run: nmake /NOLOGO
- name: Run tests
working-directory: build/tests
run: nmake /NOLOGO check "TESTARGS=-o test-results.xml,junitxml -o -,txt"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ runner.os }}
path: build/tests/test-results.xml
if-no-files-found: ignore