Salome HOME
updated copyright message
[modules/kernel.git] / src / SALOMEDS / Test / TestSALOMEDS.py
index faae31b6ee34bb6a52decf90bac283e1592f9a23..6e498cada86f1ce1c29f7857887cd08e509321c1 100644 (file)
@@ -1,13 +1,37 @@
-
-import sys, os,signal,string,commands
-import runSalome
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
+#
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import sys, os,signal,string,subprocess
+import subprocess
+import runSalomeOld
 import orbmodule
 import TestKiller
+import setenv
 
 # get SALOME environment :
 
-args, modules_list, modules_root_dir = runSalome.get_config()
-runSalome.set_env(args, modules_list, modules_root_dir)
+args, modules_list, modules_root_dir = setenv.get_config()
+setenv.set_env(args, modules_list, modules_root_dir)
 
 # launch CORBA naming server
 
@@ -15,15 +39,17 @@ clt=orbmodule.client()
 
 # launch CORBA logger server
 
-myServer=runSalome.LoggerServer(args)
+myServer=runSalomeOld.LoggerServer(args)
 myServer.run()
 clt.waitLogger("Logger")
 
 # execute Unit Test
 
-command = ['TestSALOMEDS']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+command = ['./TestSALOMEDS']
+ret = subprocess.call(command)
 
-# kill Test process 
+# kill Test process
 
-TestKiller.killProcess(runSalome.process_id)
+TestKiller.killProcess(runSalomeOld.process_id)
+TestKiller.closeSalome()
+exit(ret)