Skip to content

Commit 949c056

Browse files
committed
Detect test failure
1 parent a7f9174 commit 949c056

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Diff for: CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -457,23 +457,29 @@ endif()
457457

458458
# Add one test for each test suite case
459459
foreach(case ${PythonQtTest${suite}_cases})
460+
set(_testname tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix}_${suite}_${case})
460461
add_test(
461-
NAME tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix}_${suite}_${case}
462+
NAME ${_testname}
462463
COMMAND ${CMAKE_COMMAND}
463464
-DTARGET_FILE=$<TARGET_FILE:PythonQtDynamicLoader_${suffix}${suite_suffix}>
464465
-DSUITE=${suite} -DCASE=${case} -P ${test_wrapper}
465466
)
467+
set_tests_properties(${_testname}
468+
PROPERTIES FAIL_REGULAR_EXPRESSION "Problem running _run_pythonqt_tests")
466469
endforeach()
467470
endforeach()
468471

469472
# suite: ALL
470473
set(suite_suffix "")
471474
_add_targets("")
472475

476+
set(_testname tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix})
473477
add_test(
474-
NAME tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix}
478+
NAME ${_testname}
475479
COMMAND ${CMAKE_COMMAND} -DTARGET_FILE=$<TARGET_FILE:PythonQtDynamicLoader_${suffix}> -P ${test_wrapper}
476480
)
481+
set_tests_properties(${_testname}
482+
PROPERTIES FAIL_REGULAR_EXPRESSION "Problem running _run_pythonqt_tests")
477483

478484
endfunction()
479485

Diff for: tests/PythonQtDynamicLoaderSharedLibrary.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ extern "C"
7575

7676
for(int argpos = 0; argpos < argc; ++argpos) { delete[] argv[argpos]; }
7777

78+
if (failCount > 0)
79+
{
80+
std::cerr << "Problem running _run_pythonqt_tests" << std::endl;
81+
}
82+
7883
return failCount;
7984
}
8085

0 commit comments

Comments
 (0)