|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
DNDSR uses doctest for C++ unit tests and pytest (with pytest-mpi) for Python tests. MPI-aware C++ tests are registered with CTest at multiple process counts to verify parallel correctness.
| Module | Page | C++ tests | Python tests | Assertions |
|---|---|---|---|---|
| DNDS (core) | DNDS Core Unit Tests | 7 executables | 2 pytest files (~10 tests) | ~400 |
| Geom | Geom Module Unit Tests | 5 executables | 1 pytest file (1 test) | — |
| CFV | CFV Module Unit Tests | 3 executables | 2 pytest files (32 tests) | ~340 |
| Euler | Euler Module Unit Tests | 4 executables | — | ~310 |
| Solver | Solver Module Unit Tests | 4 executables | — | ~65 |
| Target | Contents |
|---|---|
dnds_unit_tests | All DNDS core test executables |
geom_unit_tests | All Geom test executables |
cfv_unit_tests | All CFV test executables |
euler_unit_tests | All Euler test executables |
solver_unit_tests | All Solver test executables |
all_unit_tests | All of the above |
All test executables are EXCLUDE_FROM_ALL and must be built explicitly.
MPI-aware tests are registered at multiple process counts. The CTest name encodes the count:
| Module | Process counts | Timeout |
|---|---|---|
| DNDS | np = 1, 2, 4, 8 | 120-240 s |
| Geom | np = 1, 2, 4, 8 | 120-240 s |
| CFV | np = 1, 2, 4 | 120-180 s |
| Euler | np = 1, 2, 4 | 600 s |
Serial tests have a single CTest entry with a 60-120 s timeout.
Examples: cfv_limiters, euler_evaluator_pipeline_np4, solver_ode.
Examples: test/CFV/test_fv_correctness.py::TestCellVolumes::test_wall_mesh_cell_volumes.
Many tests compare computed results against pre-captured golden values with a relative tolerance (typically 1e-6 to 1e-8). Golden values are deterministic because:
metisSeed = 42).When a golden value has not yet been captured, the sentinel 1e300 (or 0.0 in older tests) is stored. In this mode the test only prints the value and checks it is finite and non-negative — no regression assertion.
Because doctest includes <cstring>, which transitively pulls in the POSIX index() function from <strings.h>, the bare name index is ambiguous when using namespace DNDS; is active. All C++ test files qualify the DNDS type aliases as DNDS::index, DNDS::real, and DNDS::rowsize in variable declarations.
Before running Python tests, always rebuild and reinstall the pybind11 shared libraries:
If C++ source changed since the last build, stale .so files produce misleading crashes (segfaults, aborts, wrong results) that look like code bugs.