]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
[salome test] connect MEDCalc tests agr/fix_tests
authorCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 20 Apr 2016 14:56:46 +0000 (16:56 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 20 Apr 2016 15:24:29 +0000 (17:24 +0200)
CTestTestfileInstall.cmake
src/MEDCalc/CMakeLists.txt
src/MEDCalc/test/CMakeLists.txt
src/MEDCalc/test/CTestTestfileInstall.cmake
src/MEDCalc/test/test_qttesting.py
src/MEDCalculator/Test/CMakeLists.txt

index 65850b7d636778b51ba9663c2951d9f371ebc374..0fb26934ae4384fc1ab870b2dcc172f0bde1639c 100644 (file)
@@ -17,7 +17,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-SET(COMPONENT_NAME MEDCalc)
+SET(COMPONENT_NAME MEDCALC)
 SET(TIMEOUT        300)
 
 SUBDIRS(MEDCalculator)
+SUBDIRS(MEDCalc)
index d6a1e4d3a8a25ec13c97dbbbe8ff04decc4a6687..560ecadd9b65a4c9b46fdd9a4c1424ecc2546d10 100644 (file)
@@ -23,10 +23,10 @@ ADD_SUBDIRECTORY(res)
 IF(SALOME_BUILD_GUI)
   ADD_SUBDIRECTORY(gui)
 
-  IF(SALOME_MED_WITH_QTTESTING)  
+  IF(SALOME_MED_WITH_QTTESTING)
     ADD_SUBDIRECTORY(test)
   ENDIF()
-  
+
 ENDIF()
 
 IF(SALOME_MED_ENABLE_PYTHON)
index 620afc49aade6042906521c6f6e7f9a231fc55d0..329a4d3ae30b87adb5c1d51838b82971be8ab48a 100644 (file)
@@ -36,13 +36,17 @@ SET(_test_files
 )
 
 # Install rules
-SALOME_INSTALL_SCRIPTS(test_qttesting.py ${SALOME_MED_INSTALL_TEST}/MEDCalc)
-SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py ${SALOME_MED_INSTALL_TEST}/MEDCalc)
+SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc)
+
+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)
+
 INSTALL(FILES ${_test_scenarii} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/scenarios)
 INSTALL(FILES ${_test_baselines} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/baselines)
 INSTALL(FILES ${_test_files} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/medfiles)
 
-INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${SALOME_MED_INSTALL_TEST}/MEDCalc RENAME CTestTestfile.cmake)
+INSTALL(FILES CTestTestfileInstall.cmake
+  DESTINATION ${TEST_INSTALL_DIRECTORY}
+  RENAME CTestTestfile.cmake)
index f0491770c4e141150487b47de958e6056cffaf59..ef479a14e216708f8a79d3ee49c18f2fb94a543f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2016  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-SET(COMPONENT_NAME MEDCALC)
-SET(TIMEOUT        180)   # the GUI needs to start - so let some time here!
+SET(TEST_NAMES
+  test_qttesting
+)
 
-ADD_TEST(MEDCalcQtTesting python test_qttesting.py)
-SET_TESTS_PROPERTIES(MEDCalcQtTesting PROPERTIES LABELS "${COMPONENT_NAME}")
+FOREACH(tfile ${TEST_NAMES})
+  SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
+  ADD_TEST(${TEST_NAME} python ${tfile}.py)
+  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+    LABELS "${COMPONENT_NAME}"
+    TIMEOUT ${TIMEOUT}
+    )
+ENDFOREACH()
index 4a547e3d11d15cc0deef56369f4bf384a9e63d7c..e059b853bddeafe048c58892f7d5c5cfc694aebf 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2016  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,7 @@ class MEDGUITest(unittest.TestCase):
     unittest.TestCase.__init__(self, methodName=methodName)
     self._tmpDir = ""
     self._removeDir = True
-    
+
   def setUp(self):
     import tempfile
     self._tmpDir = tempfile.mkdtemp(prefix="med_gui_tests_")
@@ -37,7 +37,7 @@ class MEDGUITest(unittest.TestCase):
     unittest.TestCase.tearDown(self)
     if self._removeDir:
       shutil.rmtree(self._tmpDir, False)
-    
+
   def getTestName(self):
     """ Return name of the test being currently executed. """
     return self.id().split(".")[-1]
@@ -61,13 +61,15 @@ class MEDGUITest(unittest.TestCase):
     Assert if not matching. """
     import filecmp
     from medcalc_testutils import GetBaselineDir
-    
+
     base_pth = os.path.join(GetBaselineDir(), basename)
     gen_path = os.path.join(self._tmpDir, basename)
     print base_pth, gen_path
     try:
       ret = filecmp.cmp(base_pth, gen_path, shallow=False)
     except OSError:
+      import traceback
+      traceback.print_exc()
       ret = False
     if not ret:
       # Keep file if comparison fails
@@ -90,7 +92,7 @@ class MEDGUITest(unittest.TestCase):
     filedata = filedata.replace("/tmp/%s" % med_file, os.path.join(GetMEDFileDir(), med_file))
     with open(scen_pth2,'w') as f:
       f.write(filedata)
-      
+
   ##
   ## Now the tests themselves
   ##
index e7e937c4ec1220ecafd477b8759bba0402588250..8dbaa37748ba12f6614b9e920ca4a8df7621bbc8 100644 (file)
@@ -45,7 +45,7 @@ INSTALL(TARGETS TestMEDCalculator DESTINATION ${SALOME_INSTALL_BINS})
 
 # Application tests
 
-SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/MEDCalculator)
+SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalculator)
 INSTALL(TARGETS TestMEDCalculator DESTINATION ${TEST_INSTALL_DIRECTORY})
 
 INSTALL(FILES CTestTestfileInstall.cmake