Salome HOME
d43feda77a623f1e0009d658b23d42bdfc6154b5
[modules/kernel.git] / bin / appliskel / salome_tester / README
1 This package contains a test driver to run component tests in a SALOME session.
2 This note presents the procedure to declare tests that will be runnable from a SALOME application (through the salome command).
3
4
5 I. Write, declare, build and install tests
6 ==========================================
7
8 Each module test folder must contain:
9    - a set of test source files
10    - a CMakeLists.txt that:
11       - declare unit tests (not requiring a SALOME session) only
12       - build test files from sources if necessary
13       - install test files in <module_install_path>/bin/salome/test/
14       - install the CTestTestfileInstall.cmake file (see below) as <module_install_path>/bin/salome/test/CTestTestfile.cmake (rename file)
15    - a CTestTestfileInstall.cmake that:
16       - declare tests requiring a SALOME session
17
18 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.
19 It can refer the ABSOLUTE_APPLI_PATH variable (automatically set when using application).
20 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.
21       SET(SALOME_TEST_DRIVER "$ENV{ABSOLUTE_APPLI_PATH}/bin/salome/appliskel/salome_test_driver.py")
22       SET(TIMEOUT        500)
23       ADD_TEST(SalomeLauncher python ${SALOME_TEST_DRIVER} ${TIMEOUT} test_launcher.py)
24 Call explicitly python when using this test driver.
25
26 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.
27       SET(COMPONENT_NAME KERNEL)
28       SET_TESTS_PROPERTIES(SalomeLauncher PROPERTIES LABELS "${COMPONENT_NAME}")
29
30
31 You can have a look at KERNEL/src/Launcher/Test/ directory for a working example.
32
33
34 II. Run tests
35 =============
36
37 Tests are run with the "salome test" command (in a terminal).
38 Enter "salome test --help" for detailed usage.