From 4f1c20444358ec591ed7717d3560f728e265eb7f Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 21 May 2024 11:46:43 +0200 Subject: [PATCH] [CEA 41787][Windows] RESTRICTED tests are not run --- test.hdfs/CTestTestfileInstall.cmake | 10 +++++++--- test.hdfs/testme.py | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) 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: -- 2.39.2