From 9e81f374729b2eea764291c3c2f99ef448260677 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Mon, 18 Jul 2016 14:59:48 +0200 Subject: [PATCH] [MEDCalc] test script must exit with actual unittest runner status --- src/MEDCalc/test/gui/CMakeLists.txt | 2 +- src/MEDCalc/test/gui/medcalc_testutils.py.in | 2 +- src/MEDCalc/test/gui/test_qttesting.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MEDCalc/test/gui/CMakeLists.txt b/src/MEDCalc/test/gui/CMakeLists.txt index cb6df7349..188391e28 100644 --- a/src/MEDCalc/test/gui/CMakeLists.txt +++ b/src/MEDCalc/test/gui/CMakeLists.txt @@ -41,7 +41,7 @@ SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc/gui) SALOME_INSTALL_SCRIPTS(test_qttesting.py ${TEST_INSTALL_DIRECTORY}) SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py ${TEST_INSTALL_DIRECTORY}) -SALOME_INSTALL_SCRIPTS("${_test_scripts}" ${SALOME_INSTALL_PYTHON}/tests) +SALOME_INSTALL_SCRIPTS("${_test_scripts}" ${SALOME_INSTALL_PYTHON}/tests/gui) INSTALL(FILES ${_test_scenarii} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/gui/scenarios) INSTALL(FILES ${_test_baselines} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/gui/baselines) diff --git a/src/MEDCalc/test/gui/medcalc_testutils.py.in b/src/MEDCalc/test/gui/medcalc_testutils.py.in index bcdf7f9a3..0b50e06c5 100644 --- a/src/MEDCalc/test/gui/medcalc_testutils.py.in +++ b/src/MEDCalc/test/gui/medcalc_testutils.py.in @@ -24,7 +24,7 @@ def __getRootDir(): return rootDir def GetScriptDir(): - relativeDir = "@SALOME_INSTALL_PYTHON@/tests" + relativeDir = "@SALOME_INSTALL_PYTHON@/tests/gui" return os.path.join(__getRootDir(), relativeDir) def GetScenarioDir(): diff --git a/src/MEDCalc/test/gui/test_qttesting.py b/src/MEDCalc/test/gui/test_qttesting.py index e059b853b..1983febb9 100644 --- a/src/MEDCalc/test/gui/test_qttesting.py +++ b/src/MEDCalc/test/gui/test_qttesting.py @@ -18,7 +18,7 @@ # # Author: A. Bruneton (CEA) -import unittest, os, shutil +import unittest, os, shutil, sys from posixpath import basename class MEDGUITest(unittest.TestCase): @@ -117,5 +117,7 @@ if __name__ == "__main__": suite.addTest(MEDGUITest('testScalarMap')) suite.addTest(MEDGUITest('testScalarMap2')) # suite.addTest(MEDGUITest('testIsoContour')) - unittest.TextTestRunner().run(suite) + runner = unittest.TextTestRunner() + ret = not runner.run(suite).wasSuccessful() + sys.exit(ret) -- 2.39.2