diff --git a/scripts/run_unit_tests.sh b/scripts/run_unit_tests.sh index 292c6c9d3f..bd9e969227 100755 --- a/scripts/run_unit_tests.sh +++ b/scripts/run_unit_tests.sh @@ -9,4 +9,6 @@ ROOT_DIR="$(dirname "$0")/.." cd "${ROOT_DIR}" || exit 1 -ctest --test-dir build/tests -L "Http|PlaceholderParser" --output-junit "$(pwd)/ctest_results.xml" --output-on-failure -j +# Run the whole suite, excluding tests tagged [NotWorking]. +# --no-tests=error fails the job if the filter matches nothing (instead of passing green). +ctest --test-dir build/tests -LE "NotWorking" --no-tests=error --output-junit "$(pwd)/ctest_results.xml" --output-on-failure -j diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6b93962a33..1108fe9350 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,6 +47,11 @@ function(orcaslicer_copy_test_dlls) endforeach() endfunction() +# Register Catch2 tags as CTest labels so `ctest -L`/`-LE` can filter by tag. +function(orcaslicer_discover_tests TARGET) + catch_discover_tests(${TARGET} ADD_TAGS_AS_LABELS) +endfunction() + add_subdirectory(libnest2d) add_subdirectory(libslic3r) add_subdirectory(slic3rutils) diff --git a/tests/fff_print/CMakeLists.txt b/tests/fff_print/CMakeLists.txt index 452a40adb9..1467c1397f 100644 --- a/tests/fff_print/CMakeLists.txt +++ b/tests/fff_print/CMakeLists.txt @@ -21,4 +21,4 @@ set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests") orcaslicer_copy_test_dlls() -catch_discover_tests(${_TEST_NAME}_tests) +orcaslicer_discover_tests(${_TEST_NAME}_tests) diff --git a/tests/libnest2d/CMakeLists.txt b/tests/libnest2d/CMakeLists.txt index 6ead7f11a0..2c36b9cdcb 100644 --- a/tests/libnest2d/CMakeLists.txt +++ b/tests/libnest2d/CMakeLists.txt @@ -10,4 +10,4 @@ set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests") orcaslicer_copy_test_dlls() -catch_discover_tests(${_TEST_NAME}_tests) +orcaslicer_discover_tests(${_TEST_NAME}_tests) diff --git a/tests/libslic3r/CMakeLists.txt b/tests/libslic3r/CMakeLists.txt index 1824df8dc0..9c451e0456 100644 --- a/tests/libslic3r/CMakeLists.txt +++ b/tests/libslic3r/CMakeLists.txt @@ -38,4 +38,4 @@ set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests") orcaslicer_copy_test_dlls() -catch_discover_tests(${_TEST_NAME}_tests) +orcaslicer_discover_tests(${_TEST_NAME}_tests) diff --git a/tests/sla_print/CMakeLists.txt b/tests/sla_print/CMakeLists.txt index bb53f5bee2..b348e21bdc 100644 --- a/tests/sla_print/CMakeLists.txt +++ b/tests/sla_print/CMakeLists.txt @@ -9,4 +9,4 @@ set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests") orcaslicer_copy_test_dlls() -catch_discover_tests(${_TEST_NAME}_tests) +orcaslicer_discover_tests(${_TEST_NAME}_tests) diff --git a/tests/slic3rutils/CMakeLists.txt b/tests/slic3rutils/CMakeLists.txt index e734fcf6c6..30f58a9562 100644 --- a/tests/slic3rutils/CMakeLists.txt +++ b/tests/slic3rutils/CMakeLists.txt @@ -12,4 +12,4 @@ set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests") orcaslicer_copy_test_dlls() -catch_discover_tests(${_TEST_NAME}_tests) +orcaslicer_discover_tests(${_TEST_NAME}_tests) diff --git a/tests/slic3rutils/slic3rutils_tests_main.cpp b/tests/slic3rutils/slic3rutils_tests_main.cpp index cea6934e8e..e29b518f3d 100644 --- a/tests/slic3rutils/slic3rutils_tests_main.cpp +++ b/tests/slic3rutils/slic3rutils_tests_main.cpp @@ -53,7 +53,8 @@ TEST_CASE("Check SSL certificates paths", "[Http][NotWorking]") { REQUIRE(status == 200); } -TEST_CASE("Orca cloud flat session resolves display name consistently", "[OrcaCloudServiceAgent]") +// [NotWorking]: OrcaCloudServiceAgent ctor segfaults headless (wxStandardPaths::Get() -> null wxTheApp). +TEST_CASE("Orca cloud flat session resolves display name consistently", "[OrcaCloudServiceAgent][NotWorking]") { CHECK(resolved_display_name(flat_session_json({ {"username", "orca_username"}, @@ -81,7 +82,8 @@ TEST_CASE("Orca cloud flat session resolves display name consistently", "[OrcaCl })) == "orca_username"); } -TEST_CASE("Orca cloud nested session resolves display name consistently", "[OrcaCloudServiceAgent]") +// [NotWorking]: see flat-session test above. +TEST_CASE("Orca cloud nested session resolves display name consistently", "[OrcaCloudServiceAgent][NotWorking]") { CHECK(resolved_display_name(nested_session_json({ {"username", "orca_username"},