IF(NOT SalomeKERNEL_FOUND)
MESSAGE("SalomeKERNEL not found. Salome installation paths will not be used")
+ELSE()
+ SET(SALOME_BUILD_TESTS ON)
+ SET(SALOME_YDEFX_INSTALL_TEST ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test CACHE PATH
+ "Install path: SALOME Test files")
ENDIF()
IF(NOT DEFINED SALOME_INSTALL_PYTHON)
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+# For salome test
+IF(SALOME_BUILD_TESTS)
+ INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${SALOME_YDEFX_INSTALL_TEST}
+ RENAME CTestTestfile.cmake)
+ENDIF(SALOME_BUILD_TESTS)
+
ADD_SUBDIRECTORY(cpp)
ADD_SUBDIRECTORY(pydefx)
IF(YDEFX_BUILD_GUI)
--- /dev/null
+# Copyright (C) 2019 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(SALOME_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/salome_test_driver.py")
+
+SET(COMPONENT_NAME YDEFX)
+SET(TIMEOUT 500)
+
+SUBDIRS(
+ cpp
+ )
if(Py_None != pyValue)
check.addError(py2cpp::fromPy(pyValue, cppValue));
if(check)
- sample.errors().push_back(cppValue);
+ sample.errors()[i] = cppValue;
}
}
else
ADD_TEST(YdefxStudyRestartTest StudyRestartTest)
SET_TESTS_PROPERTIES(YdefxStudyRestartTest PROPERTIES ENVIRONMENT
"PYTHONPATH=${CMAKE_SOURCE_DIR}/src:$ENV{PYTHONPATH}")
+IF(SALOME_BUILD_TESTS)
+ # For salome test
+ SET(LOCAL_TEST_DIR ${SALOME_YDEFX_INSTALL_TEST}/cpp)
+ INSTALL(TARGETS SampleTest DESTINATION ${LOCAL_TEST_DIR})
+ INSTALL(TARGETS StudyGeneralTest DESTINATION ${LOCAL_TEST_DIR})
+ INSTALL(TARGETS StudyRestartTest DESTINATION ${LOCAL_TEST_DIR})
+ INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${LOCAL_TEST_DIR}
+ RENAME CTestTestfile.cmake)
+ENDIF()
--- /dev/null
+# Copyright (C) 2019 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_NAME ${COMPONENT_NAME}_SampleTest)
+ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ./SampleTest)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ )
+
+SET(TEST_NAME ${COMPONENT_NAME}_StudyGeneralTest)
+ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ./StudyGeneralTest)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ )
+
+SET(TEST_NAME ${COMPONENT_NAME}_StudyRestartTest)
+ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ./StudyRestartTest)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ )
+
"""
if sampleManager is None:
sampleManager = defaultSampleManager()
+ if not os.path.exists(result_directory):
+ os.makedirs(result_directory)
# export sample to result_directory
inputFiles = sampleManager.prepareRun(script, sample, result_directory)
datapath = SampleIterator.DATAFILE
outputnamespath = SampleIterator.OUTPUTNAMESFILE
resultpath = SampleIterator.RESULTFILE
-
+
self.iterNb = -1
self.datafile = open(datapath, newline='')
self.data = csv.DictReader(self.datafile, quoting=csv.QUOTE_NONNUMERIC)