-import os
-U = os.getenv('USER')
-f=open("/tmp/" + U + "/UnitTestsResult", 'a')
-f.write(" --- TEST src/yacsloader: testSave.py\n")
-suite = unittest.makeSuite(TestSave)
-result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
-f.close()
-sys.exit(not result.wasSuccessful())
+if __name__ == '__main__':
+ import salome
+ import NamingService
+ import os
+ import subprocess
+ salome.salome_init()
+ ior = NamingService.NamingService.IOROfNS()
+ p = subprocess.Popen(["../yacsloader/echoSrv",ior])
+ import time
+ time.sleep(3)
+ with tempfile.TemporaryDirectory(suffix=".yacstest") as dir_test:
+ file_test = os.path.join(dir_test,"UnitTestsResult")
+ with open(file_test, 'a') as f:
+ f.write(" --- TEST src/yacsloader: testSave.py\n")
+ suite = unittest.makeSuite(TestSave)
+ result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
+ p.terminate()
+ sys.exit(not result.wasSuccessful())