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
24 # --- CMAKE_BINARY_DIR is used in make test
26 sys.path.insert(0,"@CMAKE_CURRENT_SOURCE_DIR@")
27 sys.path.insert(0,"@CMAKE_BINARY_DIR@/src/engine_swig")
28 sys.path.insert(0,"@CMAKE_BINARY_DIR@/src/runtime_swig")
29 sys.path.insert(0,"@CMAKE_BINARY_DIR@/src/engine_swig/.libs")
30 sys.path.insert(0,"@CMAKE_BINARY_DIR@/src/runtime_swig/.libs")
31 sys.path.insert(0,"@CMAKE_SOURCE_DIR@/src/engine_swig")
32 sys.path.insert(0,"@CMAKE_SOURCE_DIR@/src/runtime_swig")
39 class TestSalomeLoader(unittest.TestCase):
41 SALOMERuntime.RuntimeSALOME_setRuntime()
42 self.loader=salomeloader.SalomeLoader()
45 """test GeomGraph.xml"""
46 p= self.loader.load(os.path.join("@CMAKE_CURRENT_SOURCE_DIR@","samples","GeomGraph.xml"))
47 p.saveSchema("tata.xml")
50 """test GeomGraphGates_py.xml"""
51 p= self.loader.load(os.path.join("@CMAKE_CURRENT_SOURCE_DIR@","samples","GeomGraphGates_py.xml"))
52 p.saveSchema("tata.xml")
55 """test GeomGraphGates.xml"""
56 p= self.loader.load(os.path.join("@CMAKE_CURRENT_SOURCE_DIR@","samples","GeomGraphGates.xml"))
57 p.saveSchema("tata.xml")
60 """test GeomGraph_py.xml"""
61 p= self.loader.load(os.path.join("@CMAKE_CURRENT_SOURCE_DIR@","samples","GeomGraph_py.xml"))
62 p.saveSchema("tata.xml")
65 """test Graph_couronne.xml"""
66 p= self.loader.load(os.path.join("@CMAKE_CURRENT_SOURCE_DIR@","samples","Graph_couronne.xml"))
67 p.saveSchema("tata.xml")
70 """test testvisu20.xml"""
71 p= self.loader.load(os.path.join("@CMAKE_CURRENT_SOURCE_DIR@","samples","testvisu20.xml"))
72 p.saveSchema("tata.xml")
75 with open("/tmp/" + U + "/UnitTestsResult", 'a') as f:
76 f.write(" --- TEST src/salomeloader: testSalomeLoader.py\n")
77 suite = unittest.makeSuite(TestSalomeLoader)
78 result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
79 sys.exit(not result.wasSuccessful())