From 949c05644ddc194733db40bb77377b897fa0adcb Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 17 Feb 2016 01:40:29 -0500 Subject: [PATCH] Detect test failure --- CMakeLists.txt | 10 ++++++++-- tests/PythonQtDynamicLoaderSharedLibrary.cpp | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc84ea46..64a8a0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -457,12 +457,15 @@ 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=$ -DSUITE=${suite} -DCASE=${case} -P ${test_wrapper} ) + set_tests_properties(${_testname} + PROPERTIES FAIL_REGULAR_EXPRESSION "Problem running _run_pythonqt_tests") endforeach() endforeach() @@ -470,10 +473,13 @@ endif() 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=$ -P ${test_wrapper} ) + set_tests_properties(${_testname} + PROPERTIES FAIL_REGULAR_EXPRESSION "Problem running _run_pythonqt_tests") endfunction() diff --git a/tests/PythonQtDynamicLoaderSharedLibrary.cpp b/tests/PythonQtDynamicLoaderSharedLibrary.cpp index 87a7771e..413a1921 100644 --- a/tests/PythonQtDynamicLoaderSharedLibrary.cpp +++ b/tests/PythonQtDynamicLoaderSharedLibrary.cpp @@ -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; }