Salome HOME
Yacs decorator
[modules/yacs.git] / src / py2yacs / Test / CMakeLists.txt
1 # Copyright (C) 2012-2020  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE_DIRECTORIES(
21   ${CPPUNIT_INCLUDE_DIRS}
22   ${CMAKE_CURRENT_SOURCE_DIR}/..
23 )
24
25 SET(_link_LIBRARIES
26   ${CPPUNIT_LIBRARIES} 
27   py2yacslib
28 )
29
30 SET(Py2yacsTest_SOURCES
31   TestPy2yacs.cxx
32   Py2yacsTest.cxx
33   Py2yacsTest.hxx
34 )
35
36 ADD_EXECUTABLE(TestPy2yacs ${Py2yacsTest_SOURCES})
37 TARGET_LINK_LIBRARIES(TestPy2yacs ${_link_LIBRARIES})
38
39 ADD_EXECUTABLE(test_py2yacs test_py2yacs.cxx)
40 TARGET_LINK_LIBRARIES(test_py2yacs py2yacslib)
41
42 # For salome test
43 IF(NOT WIN32)
44   # This test needs a running salome session
45   # TODO: Run the test in a salome session with make test
46   #ADD_TEST(TestPy2yacs TestPy2yacs)
47   #SET_TESTS_PROPERTIES(TestPy2yacs PROPERTIES
48   #                     ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_SOURCE_DIR}/..:$ENV{PYTHONPATH}"
49   #                    )
50
51   SET(LOCAL_TEST_DIR ${SALOME_YACS_INSTALL_TEST}/py2yacs)
52   SET(LOCAL_TEST_FILES
53     bad_parsers.py
54     err_py2yacs_invalid.py
55     testforeach.py
56     formule.py
57     )
58   SET(LOCAL_TEST_SCRIPTS
59     testDeco.py
60     )
61   INSTALL(FILES ${LOCAL_TEST_FILES}
62           DESTINATION ${LOCAL_TEST_DIR})
63   INSTALL(PROGRAMS ${LOCAL_TEST_SCRIPTS}
64         DESTINATION ${LOCAL_TEST_DIR})
65   INSTALL(FILES CTestTestfileInstall.cmake
66           DESTINATION ${LOCAL_TEST_DIR}
67           RENAME CTestTestfile.cmake)
68   INSTALL(TARGETS TestPy2yacs test_py2yacs
69           DESTINATION ${LOCAL_TEST_DIR})
70
71 ENDIF()