]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/salomeloader/testSalomeLoader.py.in
Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / salomeloader / testSalomeLoader.py.in
diff --git a/src/salomeloader/testSalomeLoader.py.in b/src/salomeloader/testSalomeLoader.py.in
new file mode 100755 (executable)
index 0000000..cf6be63
--- /dev/null
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+# Copyright (C) 2006-2012  CEA/DEN, EDF R&D
+#
+# 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.
+#
+# 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
+import os
+
+# --- top_builddir is used in make check
+# --- top_srcdir is used in make distcheck
+
+sys.path.insert(0,"@srcdir@")
+sys.path.insert(0,"@top_builddir@/src/engine_swig")
+sys.path.insert(0,"@top_builddir@/src/runtime_swig")
+sys.path.insert(0,"@top_builddir@/src/engine_swig/.libs")
+sys.path.insert(0,"@top_builddir@/src/runtime_swig/.libs")
+sys.path.insert(0,"@top_srcdir@/src/engine_swig")
+sys.path.insert(0,"@top_srcdir@/src/runtime_swig")
+
+import unittest
+import pilot
+import SALOMERuntime
+import salomeloader
+
+class TestSalomeLoader(unittest.TestCase):
+  def setUp(self):
+    SALOMERuntime.RuntimeSALOME_setRuntime()
+    self.loader=salomeloader.SalomeLoader()
+
+  def test1(self):
+    """test GeomGraph.xml"""
+    p= self.loader.load(os.path.join("@srcdir@","samples","GeomGraph.xml"))
+    p.saveSchema("tata.xml")
+
+  def test2(self):
+    """test GeomGraphGates_py.xml"""
+    p= self.loader.load(os.path.join("@srcdir@","samples","GeomGraphGates_py.xml"))
+    p.saveSchema("tata.xml")
+
+  def test3(self):
+    """test GeomGraphGates.xml"""
+    p= self.loader.load(os.path.join("@srcdir@","samples","GeomGraphGates.xml"))
+    p.saveSchema("tata.xml")
+
+  def test4(self):
+    """test GeomGraph_py.xml"""
+    p= self.loader.load(os.path.join("@srcdir@","samples","GeomGraph_py.xml"))
+    p.saveSchema("tata.xml")
+
+  def test5(self):
+    """test Graph_couronne.xml"""
+    p= self.loader.load(os.path.join("@srcdir@","samples","Graph_couronne.xml"))
+    p.saveSchema("tata.xml")
+
+  def test6(self):
+    """test testvisu20.xml"""
+    p= self.loader.load(os.path.join("@srcdir@","samples","testvisu20.xml"))
+    p.saveSchema("tata.xml")
+
+U = os.getenv('USER')
+f=open("/tmp/" + U + "/UnitTestsResult", 'a')
+f.write("  --- TEST src/salomeloader: testSalomeLoader.py\n")
+suite = unittest.makeSuite(TestSalomeLoader)
+result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
+f.close()
+sys.exit(not result.wasSuccessful())
+