X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Ftests.py.in;fp=doc%2Fsalome%2Fexamples%2Ftests.py.in;h=0000000000000000000000000000000000000000;hb=23463956b04e8eea1c10e6450d20693f51561b5d;hp=3b1f8800fc88a1496f8f7fd4f3ffe967c94697b5;hpb=a847e2c6495ef248da62fb22dca24e4875d4f16f;p=modules%2Fgeom.git diff --git a/doc/salome/examples/tests.py.in b/doc/salome/examples/tests.py.in deleted file mode 100644 index 3b1f8800f..000000000 --- a/doc/salome/examples/tests.py.in +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (C) 2018-2021 CEA/DEN, EDF R&D, OPEN CASCADE -# -# 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, or (at your option) any later version. -# -# 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 -# - -DIR='@CMAKE_CURRENT_SOURCE_DIR@' -TESTS='@GOOD_TESTS@' -REINIT_SALOME=@TEST_REINIT_SALOME@ - -import os -import unittest -import salome - -class MyTest(unittest.TestCase): - def setUp(self): - if REINIT_SALOME: - salome.salome_init() - def tearDown(self): - if REINIT_SALOME: - salome.salome_close() - pass - -if __name__ == "__main__": - tests = TESTS.split(';') - for test in tests: - file_name = os.path.basename(test) - if os.path.isabs(test): - file_path = file_name - else: - file_path = os.path.join(DIR, file_name) - case_name = 'test_' + file_name[:-3] - code = """ -def func(self): - with open('{}') as f: - exec(f.read()) -""" - exec(code.format(file_path)) - setattr(MyTest, case_name, func) - - unittest.main()