Skip to content

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 thor executable.

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:

cd <build_directory>
./tests/thor_tests

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*"

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:

cd regression_tests/CI/shellmodel
bash test_peel.sh PATH_TO_THOR_BUILD/thor

With CTest

CTest is the recommended way to run the entire test suite. From your build directory:

cd <build_directory>
ctest

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:

bash manual_cdash.sh

Requires gh, act, and a .env_cdash file containing CDASH_AUTH_TOKEN.