2 # Copyright (C) 2006-2022 CEA/DEN, EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
32 class TestExecForEachGeoMesh(unittest.TestCase):
35 SALOMERuntime.RuntimeSALOME_setRuntime(1)
36 self.l = loader.YACSLoader()
37 self.e = pilot.ExecutorSwig()
38 self.p = self.l.load("samples/geomesh0ForEach.xml")
41 @unittest.skipIf("SMESH_ROOT_DIR" not in os.environ, "requires SMESH (and GEOM)")
43 # --- start execution, run without breakpoints
46 print("================= Start of CONTINUE =====================")
47 self.e.setExecMode(0) # YACS::CONTINUE
48 run1 = threading.Thread(None, self.e.RunPy, "continue", (self.p,0))
54 self.assertEqual(106, self.p.getChildByName('PyScript0').getEffectiveState())
55 print("================= End of CONTINUE =======================")
60 if __name__ == '__main__':
61 dir_test = tempfile.mkdtemp(suffix=".yacstest")
62 file_test = os.path.join(dir_test,"UnitTestsResult")
63 with open(file_test, 'a') as f:
64 f.write(" --- TEST src/yacsloader: testExec.py\n")
65 suite = unittest.makeSuite(TestExecForEachGeoMesh)
66 result = unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
68 sys.exit(not result.wasSuccessful())