From 684766015f20f7ba14452a1980ba470c67b7f34c Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Tue, 19 Jul 2016 14:00:41 +0200 Subject: [PATCH] [MEDCalc] Add tui tests --- src/MEDCalc/test/CMakeLists.txt | 3 ++ src/MEDCalc/test/gui/CMakeLists.txt | 3 -- src/MEDCalc/test/gui/test_qttesting.py | 14 +++---- src/MEDCalc/test/gui/test_scalarmap.py | 7 ++-- .../test/{gui => }/medcalc_testutils.py.in | 16 ++++++-- src/MEDCalc/test/tui/CMakeLists.txt | 16 ++++++++ .../test/tui/CTestTestfileInstall.cmake | 8 ++++ src/MEDCalc/test/tui/access_API.py | 27 +++++++++++++ src/MEDCalc/test/tui/import_pvsimple.py | 20 +++++++++ src/MEDCalc/test/tui/load_file.py | 34 ++++++++++++++++ src/MEDCalc/test/tui/medcalc_test_utils.py | 0 .../tui/medfiles/smooth_surface_and_field.med | Bin 0 -> 16209 bytes src/MEDCalc/test/tui/scalar_map.py | 38 ++++++++++++++++++ src/MEDCalc/test/tui/tests.set | 25 ++++++++++++ 14 files changed, 194 insertions(+), 17 deletions(-) rename src/MEDCalc/test/{gui => }/medcalc_testutils.py.in (83%) create mode 100644 src/MEDCalc/test/tui/access_API.py create mode 100644 src/MEDCalc/test/tui/import_pvsimple.py create mode 100644 src/MEDCalc/test/tui/load_file.py create mode 100644 src/MEDCalc/test/tui/medcalc_test_utils.py create mode 100644 src/MEDCalc/test/tui/medfiles/smooth_surface_and_field.med create mode 100644 src/MEDCalc/test/tui/scalar_map.py create mode 100644 src/MEDCalc/test/tui/tests.set diff --git a/src/MEDCalc/test/CMakeLists.txt b/src/MEDCalc/test/CMakeLists.txt index 72cf4a1a5..964172e05 100644 --- a/src/MEDCalc/test/CMakeLists.txt +++ b/src/MEDCalc/test/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +SALOME_CONFIGURE_FILE(medcalc_testutils.py.in ${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py) + IF(SALOME_BUILD_GUI) IF(SALOME_MED_WITH_QTTESTING) ADD_SUBDIRECTORY(gui) @@ -28,6 +30,7 @@ IF(SALOME_MED_ENABLE_PYTHON) ENDIF() SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc) +SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py ${SALOME_INSTALL_SCRIPT_SCRIPTS}) INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) diff --git a/src/MEDCalc/test/gui/CMakeLists.txt b/src/MEDCalc/test/gui/CMakeLists.txt index 188391e28..dd43e6e7c 100644 --- a/src/MEDCalc/test/gui/CMakeLists.txt +++ b/src/MEDCalc/test/gui/CMakeLists.txt @@ -17,8 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SALOME_CONFIGURE_FILE(medcalc_testutils.py.in ${CMAKE_CURRENT_BINARY_DIR}/medcalc_testutils.py) - SET(_test_scripts test_scalarmap.py ) @@ -39,7 +37,6 @@ SET(_test_files 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/gui) diff --git a/src/MEDCalc/test/gui/test_qttesting.py b/src/MEDCalc/test/gui/test_qttesting.py index 1983febb9..b5d421425 100644 --- a/src/MEDCalc/test/gui/test_qttesting.py +++ b/src/MEDCalc/test/gui/test_qttesting.py @@ -45,9 +45,9 @@ class MEDGUITest(unittest.TestCase): def launchSalomeWithScript(self, scriptname): """ TODO: review this - what is the nicest way to launch SALOME GUI from a Python script? """ from salome_instance import SalomeInstance - from medcalc_testutils import GetScriptDir + from medcalc_testutils import GetScriptDirGUI args = "args:%s" % self._tmpDir - pth = os.path.join(GetScriptDir(), scriptname) + pth = os.path.join(GetScriptDirGUI(), scriptname) # Launch SALOME with the test script: inst = SalomeInstance.start(with_gui=True, args=[pth, args]) # And make sure SALOME is stopped before running next one: @@ -60,9 +60,9 @@ class MEDGUITest(unittest.TestCase): """ Compare the screenshot in the current temporary test directory with the reference baseline. Assert if not matching. """ import filecmp - from medcalc_testutils import GetBaselineDir + from medcalc_testutils import GetBaselineDirGUI - base_pth = os.path.join(GetBaselineDir(), basename) + base_pth = os.path.join(GetBaselineDirGUI(), basename) gen_path = os.path.join(self._tmpDir, basename) print base_pth, gen_path try: @@ -79,8 +79,8 @@ class MEDGUITest(unittest.TestCase): def prepareScenario(self, scenario, baseline, med_file): """ Copy scenario to current temporary test dir and substitute paths inside """ - from medcalc_testutils import GetScenarioDir, GetMEDFileDir - scen_path = os.path.join(GetScenarioDir(), scenario) + from medcalc_testutils import GetScenarioDirGUI, GetMEDFileDirGUI + scen_path = os.path.join(GetScenarioDirGUI(), scenario) scen_pth2 = os.path.join(self._tmpDir, scenario) try: shutil.copy(scen_path, scen_pth2) @@ -89,7 +89,7 @@ class MEDGUITest(unittest.TestCase): with open(scen_pth2,'r') as f: filedata = f.read() filedata = filedata.replace("/tmp/%s" % baseline, "%s/%s" % (self._tmpDir, baseline)) - filedata = filedata.replace("/tmp/%s" % med_file, os.path.join(GetMEDFileDir(), med_file)) + filedata = filedata.replace("/tmp/%s" % med_file, os.path.join(GetMEDFileDirGUI(), med_file)) with open(scen_pth2,'w') as f: f.write(filedata) diff --git a/src/MEDCalc/test/gui/test_scalarmap.py b/src/MEDCalc/test/gui/test_scalarmap.py index 6612eb67e..cfcb3dd75 100644 --- a/src/MEDCalc/test/gui/test_scalarmap.py +++ b/src/MEDCalc/test/gui/test_scalarmap.py @@ -17,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -""" Test of the scalarmap. +""" Test of the scalarmap. This script is to be passed as an argument of the ./salome command and will be executed within the SALOME Python console. @@ -25,7 +25,8 @@ Python console. import os, sys import SalomePyQt -from medcalc_testutils import GetScenarioDir + +from medcalc_testutils import GetScenarioDirGUI sgPyQt = SalomePyQt.SalomePyQt() sgPyQt.activateModule('MED') @@ -34,4 +35,4 @@ import medcalc # After module activation !! localTestDir = sys.argv[1] medcalc.PlayQtTestingScenario(os.path.join(localTestDir, 'test_scalarmap.xml')) -medcalc.RequestSALOMETermination() # not equivalent to quit()! +medcalc.RequestSALOMETermination() # not equivalent to quit()! diff --git a/src/MEDCalc/test/gui/medcalc_testutils.py.in b/src/MEDCalc/test/medcalc_testutils.py.in similarity index 83% rename from src/MEDCalc/test/gui/medcalc_testutils.py.in rename to src/MEDCalc/test/medcalc_testutils.py.in index 0b50e06c5..77e825515 100644 --- a/src/MEDCalc/test/gui/medcalc_testutils.py.in +++ b/src/MEDCalc/test/medcalc_testutils.py.in @@ -23,18 +23,26 @@ def __getRootDir(): rootDir = os.environ.get("MED_ROOT_DIR", "") return rootDir -def GetScriptDir(): +# === GUI === + +def GetScriptDirGUI(): relativeDir = "@SALOME_INSTALL_PYTHON@/tests/gui" return os.path.join(__getRootDir(), relativeDir) -def GetScenarioDir(): +def GetScenarioDirGUI(): relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/gui/scenarios" return os.path.join(__getRootDir(), relativeDir) -def GetBaselineDir(): +def GetBaselineDirGUI(): relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/gui/baselines" return os.path.join(__getRootDir(), relativeDir) -def GetMEDFileDir(): +def GetMEDFileDirGUI(): relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/gui/medfiles" return os.path.join(__getRootDir(), relativeDir) + +# === TUI === + +def GetMEDFileDirTUI(): + relativeDir = "@SALOME_MED_INSTALL_RES_DATA@/tests/tui/medfiles" + return os.path.join(__getRootDir(), relativeDir) diff --git a/src/MEDCalc/test/tui/CMakeLists.txt b/src/MEDCalc/test/tui/CMakeLists.txt index 6bb09a53d..5bbaec134 100644 --- a/src/MEDCalc/test/tui/CMakeLists.txt +++ b/src/MEDCalc/test/tui/CMakeLists.txt @@ -17,7 +17,23 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(tests.set) + +SET(_test_files + medfiles/smooth_surface_and_field.med +) + SET(TEST_INSTALL_DIRECTORY ${SALOME_MED_INSTALL_TEST}/MEDCalc/tui) + +FOREACH(tfile ${TEST_NAMES}) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py + DESTINATION ${TEST_INSTALL_DIRECTORY}) +ENDFOREACH() + INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) + +INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) + +INSTALL(FILES ${_test_files} DESTINATION ${SALOME_MED_INSTALL_RES_DATA}/tests/tui/medfiles) diff --git a/src/MEDCalc/test/tui/CTestTestfileInstall.cmake b/src/MEDCalc/test/tui/CTestTestfileInstall.cmake index f361715a6..91bf41305 100644 --- a/src/MEDCalc/test/tui/CTestTestfileInstall.cmake +++ b/src/MEDCalc/test/tui/CTestTestfileInstall.cmake @@ -16,3 +16,11 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + +INCLUDE(tests.set) + +FOREACH(tfile ${TEST_NAMES}) + SET(TEST_NAME ${COMPONENT_NAME}_${tfile}) + ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") +ENDFOREACH() diff --git a/src/MEDCalc/test/tui/access_API.py b/src/MEDCalc/test/tui/access_API.py new file mode 100644 index 000000000..4dbff4689 --- /dev/null +++ b/src/MEDCalc/test/tui/access_API.py @@ -0,0 +1,27 @@ +# 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import medcalc +medcalc.medconsole.setConsoleGlobals(globals()) +import MEDCALC + +from medcalc.medconsole import saveWorkspace, cleanWorkspace +from medcalc.medconsole import putInWorkspace, removeFromWorkspace +from medcalc.medconsole import accessField +from medcalc.medconsole import getEnvironment, ls, la diff --git a/src/MEDCalc/test/tui/import_pvsimple.py b/src/MEDCalc/test/tui/import_pvsimple.py new file mode 100644 index 000000000..630a200e3 --- /dev/null +++ b/src/MEDCalc/test/tui/import_pvsimple.py @@ -0,0 +1,20 @@ +# 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import pvsimple as pvs diff --git a/src/MEDCalc/test/tui/load_file.py b/src/MEDCalc/test/tui/load_file.py new file mode 100644 index 000000000..ed1e5419c --- /dev/null +++ b/src/MEDCalc/test/tui/load_file.py @@ -0,0 +1,34 @@ +# 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import medcalc +medcalc.medconsole.setConsoleGlobals(globals()) +import MEDCALC + +from medcalc.medconsole import saveWorkspace, cleanWorkspace +from medcalc.medconsole import putInWorkspace, removeFromWorkspace +from medcalc.medconsole import accessField +from medcalc.medconsole import getEnvironment, ls, la + +import os + +from medcalc_testutils import GetMEDFileDirTUI + +datafile = os.path.join(GetMEDFileDirTUI(), "smooth_surface_and_field.med") +source_id = medcalc.LoadDataSource(datafile) diff --git a/src/MEDCalc/test/tui/medcalc_test_utils.py b/src/MEDCalc/test/tui/medcalc_test_utils.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/MEDCalc/test/tui/medfiles/smooth_surface_and_field.med b/src/MEDCalc/test/tui/medfiles/smooth_surface_and_field.med new file mode 100644 index 0000000000000000000000000000000000000000..226ce3b216111215c1ea59651e5db10942314ce3 GIT binary patch literal 16209 zcmeI330O_*-oV#x*bR1RE>i6h2~jD@(ED!9o#sgrm68w|iGxhXJQo==WQvd}Q|ywN za65ED2u-GDnpEHaUwgZ`(p(l%xuy*$FcjEElpgnGES*#Vc;d$7oe^X;=$730_*WlkOx5*`4 zi?sLmL{e5@#5#-1(PkJ?IKjb_PCN%j4r~IuuyGj?_$vy0+sNLzQzLBtO(S<}$4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8ka#YRS(s)0I%E>0=OVs5NhAYGIa!n>5E^bJi9a2StgL`aPp(8~X4qe>LefEN+ z&iZw0oQf>{qIyX!>oLS_AKlQ$YDFZNlarsfnME_L=H$$iYap3@M#!;mzT#)b@QkH+ z7f8S784Fj4G>~DJ6nvg#h|-6;<>z(zg~V>=)Z!bH8CsjXlo`0PmSi4#6Mv=kF$w5d zd2G&8HucFk^`=q^zO$RwBkt_}FC=VP1@S)8LR>`>jDJ(gh3^kTZtdEBgrwQnrcBd+ z!QXStPp$C$UE+I{r?Dv)zL(x=bt%K9hV0j0^mOz2Poz@EIDR{?gg6@wwz|5KMbFRb zy}9U26G@lU51cTXO^Z^qMb_pwlBFs76N~Q4(EMPdrW_?ny3{c<)AV9J*%SZjj(-4~ z>Q3+(y*D1d{~Xy^qn%z#o;-@_KP_3BKJ=L`vFFJnLg&_&x~;AtYHS0`GTu9~aMhbJ zLAEVq=i2F)64j)r1$TR^+79r)LCDdmOC;#lUw8HQ9#~6mIp#<7oW!Q7)uAHW<7&u< zh=b)f0$WJ#h=VfPE7){iNy(^9Y4Ba*30b$b4%NhJ?qdsUD;7POwCa*fF?=T+cklV* zI5BGFe#)x}z8l^*BYkPsd4_h|{_&&cZ&EZr{&2=t%?gr`A9=5t*FdZ;Xd9Yw|S6K}p#ufIjI=)yyJ zuclO8AS0Tt@H|qasA16v<);T<5Z?#vg!tW3bVADRscYwmP`O%*7+$v;!dPwmZJ7N= z_&*49!`Xes=t83o1W_?-ikJwNE>;{iJASs+j9fqa^5- ztg)>37g^Ndgky758LX%E8Q#%HWT@}w)?1nnIdp7k=9OzymImleE#sTKA?M}d)cpt5 Glm7wPf<%r0 literal 0 HcmV?d00001 diff --git a/src/MEDCalc/test/tui/scalar_map.py b/src/MEDCalc/test/tui/scalar_map.py new file mode 100644 index 000000000..54541ad23 --- /dev/null +++ b/src/MEDCalc/test/tui/scalar_map.py @@ -0,0 +1,38 @@ +# 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import medcalc +medcalc.medconsole.setConsoleGlobals(globals()) +import MEDCALC + +from medcalc.medconsole import saveWorkspace, cleanWorkspace +from medcalc.medconsole import putInWorkspace, removeFromWorkspace +from medcalc.medconsole import accessField +from medcalc.medconsole import getEnvironment, ls, la + +import os + +from medcalc_testutils import GetMEDFileDirTUI + +datafile = os.path.join(GetMEDFileDirTUI(), "smooth_surface_and_field.med") +source_id = medcalc.LoadDataSource(datafile) + +presentation_id = medcalc.MakeScalarMap(accessField(source_id), MEDCALC.VIEW_MODE_REPLACE, colorMap=MEDCALC.COLOR_MAP_BLUE_TO_RED_RAINBOW) + +medcalc.RemovePresentation(presentation_id) diff --git a/src/MEDCalc/test/tui/tests.set b/src/MEDCalc/test/tui/tests.set new file mode 100644 index 000000000..112519ff0 --- /dev/null +++ b/src/MEDCalc/test/tui/tests.set @@ -0,0 +1,25 @@ +# 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 +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +SET(TEST_NAMES + access_API + load_file + import_pvsimple +# scalar_map +) -- 2.39.2