]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Revert "Tuleap24729. Full porting in SSL of BearingSeparator;Test20456;Test3061;Test3...
authorcg246364 <clarisse.genrault@cea.fr>
Fri, 27 Aug 2021 15:18:16 +0000 (17:18 +0200)
committercg246364 <clarisse.genrault@cea.fr>
Fri, 27 Aug 2021 15:18:16 +0000 (17:18 +0200)
This reverts commit ec78089677d98f984122fed70c87a7c26bcaca7f.

test.hdfs/test_hdf.py
test.hdfs/testme.py

index 75819433d4d7fabe52f3df829a3a343e47aa450e..b8ef1924e555cd3c2d3c900f99c0d356541529db 100644 (file)
@@ -32,7 +32,8 @@ class TestHDF(unittest.TestCase):
   reffile = ""
 
   def setUp(self):
-    salome.standalone()
+    salome.salome_close()
+
     salome.salome_init(self.testfile, embedded=1)
     myStudyName = salome.myStudy._get_Name()
     self.session = salome.naming_service.Resolve('/Kernel/Session')
@@ -74,13 +75,19 @@ if __name__ == "__main__":
   if len(sys.argv) > 2:
     TestHDF.reffile = sys.argv[2]
   if len(sys.argv) > 3:
-    errFile = open(sys.argv[3], 'w')
+    salomePortFile = sys.argv[3]
+  if len(sys.argv) > 4:
+    errFile = open(sys.argv[4], 'w')
 
   aTest = unittest.TestLoader().loadTestsFromTestCase(TestHDF)
   unittest.TextTestRunner(stream=errFile).run(aTest)
   errFile.close()
-  #import qtsalome
-  #qtsalome.qApp.closeAllWindows()
-  import signal
-  os.kill(os.getpid(),signal.SIGKILL)
-  
\ No newline at end of file
+
+  # 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)
index 9dd3ebc0e200e1cba0a38d9ca5c93711f38da4ec..cd56bcd3a4e9ce1ed5349c5a8406668813a01406 100644 (file)
@@ -36,12 +36,18 @@ 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(["runSalomeSL.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+  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)
   try:
     proc.communicate(timeout = testTimeout)
   except TimeoutExpired: