Testing
CTest organizes two test types:
- Unit tests (Catch2, C++): individual functions and classes in isolation.
- Regression tests (bash): end-to-end simulations against known configurations using the full
thorexecutable.
CI runs on a self-hosted GitHub Actions runner; build, test, and coverage results are submitted to CDash. See CDash below.
Private Access
The CDash dashboard is non-public. Contact the developer for access.
Unit Tests
Unit tests live in tests/ and use Catch2.
Tags
Tests are grouped with specific tags for granular control:
[cpu]- CPU-only tests (for benchmarks)[gpu]- GPU-required tests (for benchmarks)[.benchmark]- Performance benchmarks (hidden by default)[.LongRunning]- Long-running tests (hidden by default)
Running Unit Tests
First, build the thor_tests target. Afterwards, you can run the tests from your build directory:
You can also run specific tests using tags or names:
# Specific test categories
./tests/thor_tests "[cpu]"
./tests/thor_tests "[gpu]"
./tests/thor_tests "[.benchmark]" # Explicit for hidden tags
# Specific test names
./tests/thor_tests "UniformGrid*"
MPI tests
Build thor_tests_mpi and run the registered suites with:
ThorTestsMPI_2ranks runs the full MPI suite. ThorTestsMPI_4ranks repeats only
cases tagged [mpi-rank-count]: representative scalar/array reductions,
gathers, all-to-all exchanges, nonblocking ring/request handling, and communicator
splitting. These exercise different peer relationships, buffer offsets, or
subcommunicator sizes. Environment checks, timers, the barrier smoke test,
remaining reduction variants, and vector datatype tests run only at two ranks.
Add the tag when a new test benefits from checking both communicator sizes.
[AI-Codex]
Regression Tests
Regression tests are bash scripts under regression_tests/CI that run thor with specific configurations and validate the output. Scripts named test_*.sh are auto-registered with CTest and must accept the path to the thor executable as an optional argument.
Running Regression Tests
Manually
You can run a regression test script directly:
With CTest
CTest is the recommended way to run the entire test suite. From your build directory:
This will automatically discover and run all registered tests, including regression tests.
You can also run specific tests or use other CTest options:
# Run tests with names matching a regex
ctest -R <test_name_regex>
# See verbose output from tests
ctest --verbose
CDash
CI submits build, test, and coverage results to Kitware's my.cdash.org via the .github/workflows/cmake-cdash.yml workflow.
To trigger a submission manually with gh act:
Requires gh, act, and a .env_cdash file containing CDASH_AUTH_TOKEN.