-
Notifications
You must be signed in to change notification settings - Fork 14
Running 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!
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
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
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).