Salome HOME
Update copyrights
[modules/kernel.git] / bin / appliskel / tests / concurrentSession / CMakeLists.txt
index 59df15a29801543a0fca75aa9040798f141788e3..e1384c30f89209641dd08cfecca947bbf9e17df3 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2019  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.
+# 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
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-include(CTest)
-ENABLE_TESTING()
+FILE(GLOB py_scripts "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
+FILE(GLOB sh_scripts "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
 
-# define environment for running tests
-SET(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+LIST(APPEND scripts ${py_scripts} ${sh_scripts})
 
-SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
-IF(NOT EXISTS ${KERNEL_ROOT_DIR})
-  MESSAGE(FATAL_ERROR "KERNEL_ROOT_DIR undefined")
-ENDIF(NOT EXISTS ${KERNEL_ROOT_DIR})
+# Application tests
+INSTALL(FILES CTestTestfileInstall.cmake
+        DESTINATION ${KERNEL_TEST_DIR}/concurrentSession
+        RENAME CTestTestfile.cmake)
 
-SET(THIS_PYTHONPATH $ENV{KERNEL_ROOT_DIR}/bin/salome:$ENV{KERNEL_ROOT_DIR}/lib/python$ENV{PYTHON_VERSION}/site-packages/salome:$ENV{KERNEL_ROOT_DIR}/lib64/python$ENV{PYTHON_VERSION}/site-packages/salome:$ENV{PYTHONPATH})
-SET(THIS_LD_LIBRARY_PATH $ENV{KERNEL_ROOT_DIR}/lib/salome:$ENV{LD_LIBRARY_PATH})
-
-# add tests (use make test to run)
-FILE(GLOB tests "${CMAKE_CURRENT_SOURCE_DIR}/Test*.py")
-FOREACH(file ${tests})
-  GET_FILENAME_COMPONENT(testname ${file} NAME_WE)
-  ADD_TEST(${testname} ${PYTHON_EXECUTABLE} "${file}")
-  SET_PROPERTY(TEST ${testname} APPEND PROPERTY ENVIRONMENT PYTHONPATH=${THIS_PYTHONPATH} LD_LIBRARY_PATH=${THIS_LD_LIBRARY_PATH})
-ENDFOREACH()
-
-# install Python scripts
-FILE(GLOB scripts "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-SALOME_INSTALL_SCRIPTS("${scripts}" ${SALOME_INSTALL_SCRIPT_SCRIPTS}/appliskel/tests/concurrentSession)
+INSTALL(FILES ${scripts}
+        DESTINATION ${KERNEL_TEST_DIR}/concurrentSession)