From ec78089677d98f984122fed70c87a7c26bcaca7f Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 23 Aug 2021 15:10:27 +0200 Subject: [PATCH] Tuleap24729. Full porting in SSL of BearingSeparator;Test20456;Test3061;Test3139 tests --- test.hdfs/test_hdf.py | 21 +++++++-------------- test.hdfs/testme.py | 8 +------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/test.hdfs/test_hdf.py b/test.hdfs/test_hdf.py index b8ef1924e..75819433d 100644 --- a/test.hdfs/test_hdf.py +++ b/test.hdfs/test_hdf.py @@ -32,8 +32,7 @@ class TestHDF(unittest.TestCase): reffile = "" def setUp(self): - salome.salome_close() - + salome.standalone() salome.salome_init(self.testfile, embedded=1) myStudyName = salome.myStudy._get_Name() self.session = salome.naming_service.Resolve('/Kernel/Session') @@ -75,19 +74,13 @@ if __name__ == "__main__": if len(sys.argv) > 2: TestHDF.reffile = sys.argv[2] if len(sys.argv) > 3: - salomePortFile = sys.argv[3] - if len(sys.argv) > 4: - errFile = open(sys.argv[4], 'w') + errFile = open(sys.argv[3], 'w') aTest = unittest.TestLoader().loadTestsFromTestCase(TestHDF) unittest.TextTestRunner(stream=errFile).run(aTest) errFile.close() - - # close Salome GUI - port = salome_utils.getPortNumber() - proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)]) - - try: - os.remove(salomePortFile) - except: - print("Cannot remove file", file=f) + #import qtsalome + #qtsalome.qApp.closeAllWindows() + import signal + os.kill(os.getpid(),signal.SIGKILL) + \ No newline at end of file diff --git a/test.hdfs/testme.py b/test.hdfs/testme.py index cd56bcd3a..9dd3ebc0e 100644 --- a/test.hdfs/testme.py +++ b/test.hdfs/testme.py @@ -36,18 +36,12 @@ if __name__ == '__main__': testdatafile = sys.argv[2] tempdir = tempfile.gettempdir() - portlogfile = tempdir + "/.salome_port" testlogfile = tempdir + "/test.log" - # remove port file if any - try: - os.remove(portlogfile) - except: - pass isOk = True error = "" - proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "--ns-port-log=" + portlogfile, "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + portlogfile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + proc = subprocess.Popen(["runSalomeSL.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) try: proc.communicate(timeout = testTimeout) except TimeoutExpired: -- 2.39.2