3 # Copyright (C) 2020-2021 CEA/DEN, EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 if __name__ == '__main__':
25 from time import sleep
31 testTimeout = int(sys.argv[1])
33 testdatafile = sys.argv[3]
36 testdatafile = sys.argv[2]
38 tempfile = tempfile.NamedTemporaryFile()
39 testlogfile = tempfile.name
45 proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
47 proc.communicate(timeout = testTimeout)
48 except TimeoutExpired:
51 out, err = proc.communicate()
52 error = "Killed by CPU limit."
55 with open(testlogfile, 'r') as inputFile:
58 isOk = isOk and s.find("FAIL") < 0
60 os.remove(testlogfile)
64 assert isOk, "Test failed. {}".format(error)