Testing
Running the tests
ctest --test-dir build-rel --output-on-failure
ctest --test-dir build-rel -L regression
ctest --test-dir build-rel -R dam_break
Every test runs in its own directory, <build>/Tests/run/<name>, made
again at the start of the test. Nothing is written into the source tree.
Tests/run_case.py runs the executable and then the check; the test fails
if either fails. Without MPI only the 1-rank tests are registered.
Label |
Tests |
|---|---|
|
Runs whose output is checked against closed forms or pinned numbers. |
|
Runs that must stop with a non-zero exit code and a message naming the input. |
Verification gives the analytical cases and their errors; Test catalogue lists every test.
Adding a test
Tests/CMakeLists.txt has two helpers:
flume_add_regtest(<name> NPROCS <n> INPUTS <file> [ARGS <key=value>...]
[OUTPUT <regular expression>]
CHECK <command and its arguments>)
flume_add_abort_test(<name> EXPECT <regular expression> ARGS <key=value>...)
The check command runs in the test’s directory. With OUTPUT, the output
of the run must also match the regular expression. A new test is first shown
to fail against the defect it guards, or against a one-line change to the
code, and only then committed.
A case with its own files (decks, data, check script) lives in one folder
under Tests with a README.md, as Tests/Rain and Tests/Raster
do.
Continuous integration
Three workflows run on every pull request to development.
Workflow |
Jobs |
|---|---|
|
GCC and Clang with MPI, and GCC Debug with AMReX’s testing mode: build with warnings as errors, then every test. No MPI with single precision: build and the 1-rank tests. CUDA, HIP and SYCL: compile only. |
|
|
|
This documentation, with warnings as errors. |