From: Ovidiu Mircescu Date: Mon, 28 Apr 2014 09:41:36 +0000 (+0200) Subject: Replace "runSession" calls by "salome shell". X-Git-Tag: V7_5_0a1~4^2~2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e00cf7dd0e07df363a9e57de49ee38e2aaf16fff;p=tools%2Fyacsgen.git Replace "runSession" calls by "salome shell". "salome shell script.sh" was fixed in KERNEL (commit c5187011) and it returns the return value of script.sh, the same behaviour as runSession. --- diff --git a/Examples/calcium1/build.sh b/Examples/calcium1/build.sh index f0cdb2d..12c3ac0 100755 --- a/Examples/calcium1/build.sh +++ b/Examples/calcium1/build.sh @@ -3,4 +3,4 @@ make python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/calcium2/build.sh b/Examples/calcium2/build.sh index f7d4916..4873413 100755 --- a/Examples/calcium2/build.sh +++ b/Examples/calcium2/build.sh @@ -3,5 +3,5 @@ make python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/cpp1/build.sh b/Examples/cpp1/build.sh index c23f5ca..e8aa57a 100755 --- a/Examples/cpp1/build.sh +++ b/Examples/cpp1/build.sh @@ -1,5 +1,5 @@ ../exec.sh python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/cpp2/build.sh b/Examples/cpp2/build.sh index c7dfc37..a791344 100755 --- a/Examples/cpp2/build.sh +++ b/Examples/cpp2/build.sh @@ -3,5 +3,5 @@ python components.py make # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/fort1/build.sh b/Examples/fort1/build.sh index f7d4916..4873413 100755 --- a/Examples/fort1/build.sh +++ b/Examples/fort1/build.sh @@ -3,5 +3,5 @@ make python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/fort2/build.sh b/Examples/fort2/build.sh index c7dfc37..a791344 100755 --- a/Examples/fort2/build.sh +++ b/Examples/fort2/build.sh @@ -3,5 +3,5 @@ python components.py make # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/pyth1/build.sh b/Examples/pyth1/build.sh index c23f5ca..e8aa57a 100755 --- a/Examples/pyth1/build.sh +++ b/Examples/pyth1/build.sh @@ -1,5 +1,5 @@ ../exec.sh python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/pyth2/build.sh b/Examples/pyth2/build.sh index c23f5ca..e8aa57a 100755 --- a/Examples/pyth2/build.sh +++ b/Examples/pyth2/build.sh @@ -1,5 +1,5 @@ ../exec.sh python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py diff --git a/Examples/test_compo.py b/Examples/test_compo.py index d006b7e..02dd33f 100755 --- a/Examples/test_compo.py +++ b/Examples/test_compo.py @@ -8,12 +8,17 @@ import os import sys import imp -salome_module = imp.load_source("SALOME", os.path.join("appli", "salome")) +appli_dir = "appli" +sys.path[:0] = [os.path.join(appli_dir, "bin", "salome", "appliskel")] +salome_module = imp.load_source("SALOME", os.path.join(appli_dir, "salome")) class TestCompo(unittest.TestCase): def setUp(self): #start salome and connect to it - salome_module.main(["start", "-t"]) + try: + salome_module.main(["start", "-t"]) + except SystemExit, e: + pass import runSession runSession.configureSession() import setenv @@ -47,7 +52,10 @@ class TestCompo(unittest.TestCase): self.assertEqual(p.getEffectiveState(), pilot.DONE) def tearDown(self): - salome_module.main(["killall"]) + try: + salome_module.main(["killall"]) + except SystemExit, e: + pass if __name__ == '__main__': unittest.main() diff --git a/Examples/types1/build.sh b/Examples/types1/build.sh index c23f5ca..e8aa57a 100755 --- a/Examples/types1/build.sh +++ b/Examples/types1/build.sh @@ -1,5 +1,5 @@ ../exec.sh python components.py # test -appli/runSession ../test_compo.py +appli/salome shell ../test_compo.py