from time import sleep
import sys, os
import tempfile
- import psutil
testTimeout = 600
if len(sys.argv) > 3:
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: