roottest migration to CMake / CTest
Philipp Schoppe 14.07.2014
1 / 23
roottest migration to CMake / CTest Philipp Schoppe 14.07.2014 1 / - - PowerPoint PPT Presentation
roottest migration to CMake / CTest Philipp Schoppe 14.07.2014 1 / 23 Agenda Motivation CTest Part of CMake Mode of operations CTest reports roottest CTest Usage Status CTest advantages CTest disadvantages Summary 2 / 23
1 / 23
2 / 23
3 / 23
◮ Ensure SW meets its requirements ◮ Risk management ◮ Quality ensurance & improvement ◮ SW design specification ◮ But: writing tests is perceived as a burden by many
4 / 23
5 / 23
◮ automate updating ◮ configuring ◮ building ◮ testing ◮ perform memory checking ◮ submit results to a CDash
6 / 23
◮ CMake configures & builds a project ◮ CMake uses commands to add tests ◮ CTest executes tests / submits results to a dashboard
◮ CTest runs a script to control the whole build process
7 / 23
◮ TIMEOUT ◮ DEPENDS ◮ PASS_REGULAR_EXPRESSION ◮ FAIL_REGULAR_EXPRESSION ◮ WILL_FAIL ◮ LABELS ◮ . . . (ctest –help-property-list)
8 / 23
◮ ctest -N (list all tests) ◮ ctest -j4 (run all tests in parallel) ◮ ctest -R regex (run all tests matching regex) ◮ ctest -E regex (run all tests not matching regex) ◮ ctest -V (verbose output) ◮ ctest –print-labels ◮ ctest -L regex (run all tests that contain the label regex)
9 / 23
10 / 23
11 / 23
12 / 23
13 / 23
◮ Creates test (target) roottest-cling-printf-star ◮ Runs root.exe -q -l -b runstar.C (+ some
◮ Writes stdout & stderr to a logfile ◮ Compares the logfile to star.ref
◮ Checks for star.ref32 / star.ref64
◮ Associates the test with labels
14 / 23
15 / 23
◮ Migrated 349 tests ◮ Many tests left for migration ◮ Problems with python, not out-of-source ◮ Some tests are still failing (investigating...)
16 / 23
17 / 23
◮ Clear overview of all existing tests ◮ Clear reports on individual tests (+ URL to share) ◮ Easily specify individual test settings ◮ Selection of tests by labels and regular expressions ◮ Integrated, cross-platform build/testing framework
◮ Natural integration into CMake ◮ Many projects move to CMake ⇒ Easy integration ◮ Tool to setup a software testing process
◮ Visualization for timing and pass/fail status ◮ More intuitive to read ◮ Code coverage and memory checks
18 / 23
19 / 23
◮ Harder to write complex setup scripts ◮ Escape sequences can be troublesome ◮ Native regex syntax ◮ Mixing stdout / stderr may cause problems ◮ Needs time / manpower to fully migrate & validate
◮ Some tests need big setup steps ◮ Tests are not written with cross-platform support in mind 20 / 23
21 / 23
◮ Migration to CTest ⇒ Migration to more clear & systematic
◮ May restrict freedom of users (can be a good thing?)
◮ Most of the problems occured due to compatibility to old
◮ Migration to CTest in a context of paradigm shift
◮ Introduce SW testing processes / models ◮ Unit testing (googletest?) ◮ Regression testing ◮ System testing ◮ Automatic testing, fuzzing, static analysis, code coverage,
◮ Ideally: have a test engineer, never test your own code, . . .
22 / 23
23 / 23