Skip to content
Adam Anthony edited this page Jun 14, 2024 · 2 revisions

Running ATTPCROOT tests

Running all unit tests is required before submitting a PR. If a unit test is failing, it means you broke something for someone else!

Building tests

This assumes you have successfully build the code before.

In your repository go to your build folder and run cmake with tests enabled.

cd build
cmake -DBUILD_TESTS=ON ..
cmake --build . -j8

Inspect and run tests

If you are using something like VSCode then it will likely detect the tests and allow you to run them through the GUI.

Tests can be executed using the ctest command in the build directory

cd build
ctest -N        # Will list all tests
ctest -j N      # Run all tests on N cores

Running major (integration) tests

There is a suite of tests located in macro/tests to check the unpacking of AT-TPC, SpecMAT, and GADGET data. It also tests the simulation of AT-TPC data. To run the tests, the following pre-requites must be met:

  • Generate the required geometry files by running the script macro/tests/generateGeometry.sh
  • GADGETII tests must be run on fishtank (the data is to large to package with the repository)
  • SpecMAT tests require the ROOT file TTreesGETrun_9993.root be placed in the macro/tests/SpecMAT/data folder.

To run all tests run the bash script macro/tests/runAllTest.sh. To the screen it will print a summary of each test run and the return value. The output of the test scripts run are saved in a text file in each test directory (test.log).