From d86704bdcb85eefb2cc6817d14cb22d1697bcad5 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 15 May 2020 13:40:15 +0300 Subject: [PATCH] Fix for "#19007 [CEA][Windows] SALOME non regression tests on Windows" issue. --- .../tests/concurrentSession/CTestTestfileInstall.cmake | 6 +++++- .../tests/salomeCommand/CTestTestfileInstall.cmake | 6 +++++- .../tests/salomeCommand/TestLauncherSessionArgs.py | 2 ++ .../tests/salomeInstance/CTestTestfileInstall.cmake | 6 +++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bin/appliskel/tests/concurrentSession/CTestTestfileInstall.cmake b/bin/appliskel/tests/concurrentSession/CTestTestfileInstall.cmake index 00be7d656..5b333d6e6 100644 --- a/bin/appliskel/tests/concurrentSession/CTestTestfileInstall.cmake +++ b/bin/appliskel/tests/concurrentSession/CTestTestfileInstall.cmake @@ -22,8 +22,12 @@ SET(TEST_NAMES TestConcurrentSession ) +IF (WIN32) + SET(PY_EXEC $ENV{PYTHONBIN}) +ENDIF() + FOREACH(tfile ${TEST_NAMES}) SET(TEST_NAME ${COMPONENT_NAME}_SALOME_CONCURRENT_${tfile}) - ADD_TEST(${TEST_NAME} ${tfile}.py) + ADD_TEST(${TEST_NAME} ${PY_EXEC} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT}) ENDFOREACH() diff --git a/bin/appliskel/tests/salomeCommand/CTestTestfileInstall.cmake b/bin/appliskel/tests/salomeCommand/CTestTestfileInstall.cmake index cd3f3b385..f10146881 100644 --- a/bin/appliskel/tests/salomeCommand/CTestTestfileInstall.cmake +++ b/bin/appliskel/tests/salomeCommand/CTestTestfileInstall.cmake @@ -22,8 +22,12 @@ SET(TEST_NAMES TestLauncherSessionArgs ) +IF(WIN32) + SET(PY_EXEC $ENV{PYTHONBIN}) +ENDIF() + FOREACH(tfile ${TEST_NAMES}) SET(TEST_NAME ${COMPONENT_NAME}_SALOME_COMMAND_${tfile}) - ADD_TEST(${TEST_NAME} ${tfile}.py) + ADD_TEST(${TEST_NAME} ${PY_EXEC} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT}) ENDFOREACH() diff --git a/bin/appliskel/tests/salomeCommand/TestLauncherSessionArgs.py b/bin/appliskel/tests/salomeCommand/TestLauncherSessionArgs.py index 22dd8be24..536994dce 100755 --- a/bin/appliskel/tests/salomeCommand/TestLauncherSessionArgs.py +++ b/bin/appliskel/tests/salomeCommand/TestLauncherSessionArgs.py @@ -58,6 +58,8 @@ class TestSessionArgs(unittest.TestCase): def setUp(self): import tempfile self.logFile = tempfile.NamedTemporaryFile() + if sys.platform == "win32": # Close file because of permission denined on Windows + self.logFile.close() # def tearDown(self): self.logFile.close() diff --git a/bin/appliskel/tests/salomeInstance/CTestTestfileInstall.cmake b/bin/appliskel/tests/salomeInstance/CTestTestfileInstall.cmake index caa731da7..4e2f61a2d 100644 --- a/bin/appliskel/tests/salomeInstance/CTestTestfileInstall.cmake +++ b/bin/appliskel/tests/salomeInstance/CTestTestfileInstall.cmake @@ -19,8 +19,12 @@ SET(TEST_NAMES instances) +IF (WIN32) + SET(PY_EXEC $ENV{PYTHONBIN}) +ENDIF() + FOREACH(tfile ${TEST_NAMES}) SET(TEST_NAME ${COMPONENT_NAME}_SALOME_INSTANCE_${tfile}) - ADD_TEST(${TEST_NAME} ${tfile}.py) + ADD_TEST(${TEST_NAME} ${PY_EXEC} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT}) ENDFOREACH() -- 2.39.2