You are here

Running ROOT tests

We run the ROOT tests using ctest driver. All tests are defined within the CTest framework. The following tests categories exists:

  • ROOT basic tests delivered in $ROOTSYS/test
  • ROOT tutorials delivered in $ROOTSYS/tutorials
  • ROOTTEST tests that can be downloaded from roottest repository). git clone http://root.cern.ch/git/roottest.git

Running tests from the build directory (CMake)

Testing is not enabled by default when configuring the ROOT build. Enabling is done by the option testing and the option roottest to add the ROOTTEST tests to the test suit. The basic instructions are:

$ mkdir <builddir>
$ cd <builddir>
$ cmake -Dtesting=ON -Droottest=ON <root-sources-dir>
$ cmake --build
$ ctest -j8

You can select a subset of tests by using the -R <regexpr> and see the test output by adding -V to the ctest command. See the complete set of options of ctest

Running tests using an existing installation produced by CMake

It is assumed that you have the proper ROOT environment setup ( with source source <installdir>/bin/thisroot.sh )

Running the basic ROOT tests

$ mkdir runtests
$ cd runtests
$ cmake $ROOTSYS/test
$ make   # to build the test libraries and executables
$ ctest -j8

Running the ROOTTEST tests

We need to checkout the ROOTTEST repository, create a build area and configure with cmake.

$ git clone http://root.cern.ch/git/roottest.git
$ mkdir runtests
$ cd runtests
$ cmake cmake ../roottest
$ ctest -j8

Running tests using an existing installation produced by classic configure/make

It is again assumed that you have the proper ROOT environment setup ( with source <installdir>/bin/thisroot.sh). Differently to the previous case, the ROOTConfig.cmake file is not created and the cmake modules do not get installed. In this case we need to tell cmake where to find these.

Running the ROOTTEST tests

$ cmake ../roottest -DCMAKE_MODULE_PATH=${ROOTSYS}/etc/cmake\;<root-sources-dir>/cmake/modules
$ ctest -j8