Salome HOME
Merge branch 'V7_dev'
[modules/kernel.git] / bin / appliskel / salome_tester / README
1 Copyright (C) 2015-2016  CEA/DEN, EDF R&D, OPEN CASCADE
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 This package contains a test driver to run component tests in a SALOME session.
21 This note presents the procedure to declare tests that will be runnable from a SALOME application (through the salome command).
22
23
24 I. Write, declare, build and install tests
25 ==========================================
26
27 Each module test folder must contain:
28    - a set of test source files
29    - a CMakeLists.txt that:
30       - declare unit tests (not requiring a SALOME session) only
31       - build test files from sources if necessary
32       - install test files in <module_install_path>/bin/salome/test/
33       - install the CTestTestfileInstall.cmake file (see below) as <module_install_path>/bin/salome/test/CTestTestfile.cmake (rename file)
34    - a CTestTestfileInstall.cmake that:
35       - declare tests requiring a SALOME session
36
37 The CTestTestfileInstall.cmake can also declare unit tests already declared in CMakeLists.txt. Actually CTestTestfileInstall.cmake declare all tests that will be runnable from SALOME application. This file MUST NOT use cmake environment variables.
38 It can refer the ABSOLUTE_APPLI_PATH variable (automatically set when using application).
39 If a test has to be run inside a SALOME session, use the salome_test_driver.py script that need as arguments a timeout, the test file to be run and its arguments.
40       SET(SALOME_TEST_DRIVER "$ENV{ABSOLUTE_APPLI_PATH}/bin/salome/appliskel/salome_test_driver.py")
41       SET(TIMEOUT        500)
42       ADD_TEST(SalomeLauncher python ${SALOME_TEST_DRIVER} ${TIMEOUT} test_launcher.py)
43 Call explicitly python when using this test driver.
44
45 You may want to label each test with the component they are associated to. It is useful to run tests associated to a specific component.
46       SET(COMPONENT_NAME KERNEL)
47       SET_TESTS_PROPERTIES(SalomeLauncher PROPERTIES LABELS "${COMPONENT_NAME}")
48
49
50 You can have a look at KERNEL/src/Launcher/Test/ directory for a working example.
51
52
53 II. Run tests
54 =============
55
56 Tests are run with the "salome test" command (in a terminal).
57 Enter "salome test --help" for detailed usage.