Skip to content

Commit

Permalink
Detect test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Feb 17, 2016
1 parent a7f9174 commit 949c056
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,29 @@ endif()

# Add one test for each test suite case
foreach(case ${PythonQtTest${suite}_cases})
set(_testname tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix}_${suite}_${case})
add_test(
NAME tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix}_${suite}_${case}
NAME ${_testname}
COMMAND ${CMAKE_COMMAND}
-DTARGET_FILE=$<TARGET_FILE:PythonQtDynamicLoader_${suffix}${suite_suffix}>
-DSUITE=${suite} -DCASE=${case} -P ${test_wrapper}
)
set_tests_properties(${_testname}
PROPERTIES FAIL_REGULAR_EXPRESSION "Problem running _run_pythonqt_tests")
endforeach()
endforeach()

# suite: ALL
set(suite_suffix "")
_add_targets("")

set(_testname tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix})
add_test(
NAME tests_PythonQtDynamicLoading_RUN_TESTSUITE_IN_STATIC_INITIALIZER_${suffix}
NAME ${_testname}
COMMAND ${CMAKE_COMMAND} -DTARGET_FILE=$<TARGET_FILE:PythonQtDynamicLoader_${suffix}> -P ${test_wrapper}
)
set_tests_properties(${_testname}
PROPERTIES FAIL_REGULAR_EXPRESSION "Problem running _run_pythonqt_tests")

endfunction()

Expand Down
5 changes: 5 additions & 0 deletions tests/PythonQtDynamicLoaderSharedLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ extern "C"

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

if (failCount > 0)
{
std::cerr << "Problem running _run_pythonqt_tests" << std::endl;
}

return failCount;
}

Expand Down

0 comments on commit 949c056

Please sign in to comment.