Tests¶
Changed in version 2.12: Migrated from GoogleTest to Catch2. All tests use the TEST_CASE /
TEST_CASE_METHOD macros with Catch2 matchers.
The test suite has unit tests and integration tests.
All tests are registered via meson’s array iteration pattern and run with
meson test -C builddir.
Test inventory¶
Test |
File |
Data |
What it covers |
|---|---|---|---|
|
|
|
Improved dimer eigenmode search |
|
|
– |
String parsing utilities |
|
|
|
Matter construction, copy, PBC, forces |
|
|
|
LJ potential energy/force sanity |
|
|
|
ZBL potential switching function |
|
|
|
External potential file interface |
|
|
– |
Rotation/translation projection |
|
|
|
Displacement epicenter selection |
|
|
– |
Eigen storage order verification |
|
|
– |
Force call tracking registry |
|
|
|
NEB convergence on Morse cluster |
|
|
|
NEB regression (CI-NEB barrier) |
|
|
|
Eigenmode strategy pattern |
|
|
|
MinModeSaddleSearch integration |
|
|
|
CON file round-trip I/O |
|
|
|
NWChem socket potential (needs nwchem) |
Baker subset (05 / 17 / 19 / 20)¶
Full Baker is an overnight campaign. The reduced set used for client parameter checks is Baker 05, 17, 19, 20 (claisen-class + two small organics). Run those four before changing saddle defaults. Do not substitute a looser tolerance to finish the table.
Optional tests (enabled by build flags):
test_ase_pot(with_ase): ASE Python calculatortest_mta(with_metatomic): Metatomic ML potentialtest_xtb(with_xtb): XTB semiempiricaltest_cineb_xtb(with_xtb): CI-NEB with XTBtest_serve_spec(with_serve): Serve mode endpoint parsing
Writing and registering tests¶
Tests use Catch2 (amalgamated, vendored
in thirdparty/catch2/). Each test file is compiled with the amalgamated
source and linked against eonclib.
A test file that logs through the combi logger declares
static eonc::helpers::test::QuillTestLogger. That logger is a null sink.
It must be registered with quill::Frontend directly: eonc::log::get()
installs a console logger when combi does not exist yet, and the helper
would then keep it. Dimer and Lanczos info lines would fill the stdout
pipe Meson captures. On Windows that pipe is a few kilobytes and the
write blocks, so test_bench_parity runs past its 30 second limit.
Registration uses meson’s array iteration:
test_array = [
['test_name', 'TestFile.cpp', 'data_dir'],
]
foreach test : test_array
test(test.get(0),
executable(test.get(0),
sources: ['gtests/' + test.get(1),
'thirdparty/catch2/catch_amalgamated.cpp'],
dependencies: test_deps,
include_directories: _incdirs,
cpp_args: test_args,
link_with: _linkto,
),
workdir: meson.project_source_root()
+ '/client/unit_tests/data/systems/' + test.get(2),
)
endforeach
Test data¶
Test data lives in client/unit_tests/data/systems/. Each subdirectory contains
the config.ini, pos.con, and any other files needed by the test. The
neb_morse dataset (7-atom LJ cluster) is shared by most tests.
Running tests¶
# All tests
pixi run -e dev meson test -C builddir
# Single test
pixi run -e dev meson test -C builddir test_neb_lj
# With verbose output
pixi run -e dev meson test -C builddir -v