2 # Copyright (C) 2023 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
27 ior = NamingService.NamingService.IOROfNS()
29 from testEdit import TestEdit
30 from testExec import TestExec
31 from testLoader import TestLoader
32 from testSave import TestSave
34 p = subprocess.Popen(["../yacsloader/echoSrv",ior])
41 with tempfile.TemporaryDirectory(suffix=".yacstest") as dir_test:
42 file_test = os.path.join(dir_test,"UnitTestsResult")
43 with open(file_test, 'a') as f:
44 f.write(" --- TEST src/yacsloader: testLoader.py\n")
45 for zeTest in [TestEdit,TestExec,TestLoader,TestSave]:
46 suite = unittest.makeSuite(zeTest)
47 result=unittest.TextTestRunner(f, descriptions=1, verbosity=1).run(suite)
48 zeResult = result.wasSuccessful()
49 zezeResult = zeResult and zezeResult
50 zeResultStr.append( "Result for {} is {}".format(str(zeTest),zeResult) )
52 zeResultStr.append("So at the end the result is {}".format(zezeResult))
53 print("\n".join(zeResultStr))
54 returnCode = int( not zezeResult )
55 print("Return code is {}".format( returnCode ))