From: Christophe Bourcier Date: Mon, 11 Sep 2023 09:39:00 +0000 (+0200) Subject: Allow testme.py to be launched outside SHAPER (in RESTRICTED for instance) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e160151686dd9d337a1eb6150f28ad60d654105e;p=modules%2Fshaper.git Allow testme.py to be launched outside SHAPER (in RESTRICTED for instance) --- diff --git a/test.hdfs/testme.py b/test.hdfs/testme.py index bdd7089f1..3a8965943 100644 --- a/test.hdfs/testme.py +++ b/test.hdfs/testme.py @@ -25,7 +25,6 @@ if __name__ == '__main__': from time import sleep import sys, os import tempfile - import psutil testTimeout = 600 if len(sys.argv) > 3: @@ -38,13 +37,19 @@ if __name__ == '__main__': tempfile = tempfile.NamedTemporaryFile() hdffile_basename = os.path.basename(hdffile) + test_hdfpy = "test_hdf.py" + if not os.path.exists(test_hdfpy): + # add absolute path in SHAPER install directory + test_hdfpy = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "test", "HDFs", test_hdfpy) + if not os.path.exists(test_hdfpy): + raise Exception("test_hdf.py could not be found. Check your environment.") testlogfile = tempfile.name + "_" + hdffile_basename.replace(".", "_") tempfile.close() isOk = True error = "" - proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + testlogfile]) + proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", test_hdfpy, "args:" + hdffile + "," + testdatafile + "," + testlogfile]) try: proc.communicate(timeout = testTimeout) except subprocess.TimeoutExpired: