From: Nabil Ghodbane Date: Tue, 21 May 2024 09:46:43 +0000 (+0200) Subject: [CEA 41787][Windows] RESTRICTED tests are not run X-Git-Tag: V9_13_0a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Ftlpr%2F64%2Fhead;p=modules%2Fshaper.git [CEA 41787][Windows] RESTRICTED tests are not run --- diff --git a/test.hdfs/CTestTestfileInstall.cmake b/test.hdfs/CTestTestfileInstall.cmake index d77bbeeae..4d5750035 100644 --- a/test.hdfs/CTestTestfileInstall.cmake +++ b/test.hdfs/CTestTestfileInstall.cmake @@ -20,17 +20,21 @@ INCLUDE(tests.set) SET(COMPONENT_NAME SHAPER) -SET(PYTHON_TEST_DRIVER "testme.py") + +SET(PYTHON_TEST_DRIVER "$ENV{SHAPER_ROOT_DIR}/bin/salome/test/HDFs/testme.py") +IF (WIN32) + FILE(TO_CMAKE_PATH ${PYTHON_TEST_DRIVER} PYTHON_TEST_DRIVER) +ENDIF(WIN32) SET(TIMEOUT 600) FOREACH(tfile ${PUBLIC_TESTS}) SET(TEST_NAME ${COMPONENT_NAME}_HDF_${tfile}) - ADD_TEST(${TEST_NAME} ${PYTHON_TEST_DRIVER} "${TIMEOUT}" "${tfile}.hdf" "${tfile}.py") + ADD_TEST(${TEST_NAME} python ${PYTHON_TEST_DRIVER} "${TIMEOUT}" "${tfile}.hdf" "${tfile}.py") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() FOREACH(tfile ${RESTRICTED_TESTS}) SET(TEST_NAME ${COMPONENT_NAME}_HDF_${tfile}) - ADD_TEST(${TEST_NAME} ${PYTHON_TEST_DRIVER} "${TIMEOUT}" "$ENV{RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/${tfile}.hdf" "${tfile}.py") + ADD_TEST(${TEST_NAME} python ${PYTHON_TEST_DRIVER} "${TIMEOUT}" "$ENV{RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/${tfile}.hdf" "${tfile}.py") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test.hdfs/testme.py b/test.hdfs/testme.py index 01f8c1f7c..187afebb4 100644 --- a/test.hdfs/testme.py +++ b/test.hdfs/testme.py @@ -18,13 +18,13 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - if __name__ == '__main__': import subprocess from time import sleep import sys, os import tempfile + import platform testTimeout = 600 if len(sys.argv) > 3: @@ -48,8 +48,11 @@ if __name__ == '__main__': isOk = True error = "" - - proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", test_hdfpy, "args:" + hdffile + "," + testdatafile + "," + testlogfile]) + runSalome = os.path.join(os.getenv("KERNEL_ROOT_DIR"), "bin", "salome", "runSalome.py") + cmd= [runSalome , "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", test_hdfpy, "args:" + hdffile + "," + testdatafile + "," + testlogfile] + if platform.system() == "Windows" : + cmd = ["python3", *cmd] + proc = subprocess.Popen(cmd) try: proc.communicate(timeout = testTimeout) except subprocess.TimeoutExpired: