Testing

C/C++ Tests

meson setup bbdir -Dwith_tests=true -Dwith_rpc=true --buildtype=debug
meson compile -C bbdir
meson test -C bbdir --print-errorlogs

cmake works as well:

cmake -B build \
  -DRGPOT_BUILD_TESTS=ON \
  -DRGPOT_BUILD_EXAMPLES=ON \
  -DRGPOT_WITH_RPC=ON
cmake --build build
ctest --test-dir build --output-on-failure

Rust Tests

pixi r rust-test          # default features only
pixi r rust-test-all      # all features (rpc, cache, gen-header)

Or directly:

cargo nextest run --manifest-path rgpot-core/Cargo.toml
cargo test --doc --manifest-path rgpot-core/Cargo.toml  # doc tests

RPC Integration Tests

The rpctest environment includes Python bindings via pycapnp:

pixi shell -e rpctest
python tests/rpc_integ.py --server-bin ./bbdir/CppCore/potserv
python tests/rpc_integ.py \
  --server-bin ./bbdir/CppCore/potserv \
  --nwchem-smoke \
  --cpmd-smoke
python tests/test_cpmd_params.py
python tests/test_rpc_integ_cpmd.py

NWChem suite (--suite nwchem)

Frontend + stub ABI tests always build with the main library (with_tests=true). Energy/grad tests SKIP unless an external libnwchemc is on the library path (NWCHEMC_LIBRARY, RGPOT_NWCHEMC_ENGINE, or RGPOT_NWCHEM_ENGINE). The message ABI test uses a fake nwchemc_* shared library and verifies rgpot passes serialized NWChemParams bytes through the dlopen boundary.

meson setup bbdir -Dwith_tests=true -Dwith_rpc=true
meson compile -C bbdir
meson test -C bbdir --suite nwchem --print-errorlogs

See CppCore/rgpot/NWChemPot/README.md; the engine (libnwchemc) is built by the split nwchemc project, not by rgpot.

CPMD suite (--suite cpmd)

Frontend + stub ABI tests always build with the main library (with_tests=true). The CPMD frontend loads a split libcpmdc engine at runtime via CPMDC_LIBRARY, RGPOT_CPMDC_ENGINE, or RGPOT_CPMD_ENGINE. Configure-only Python smokes use PotentialConfig.cpmd and do not require a live engine.

meson setup bbdir -Dwith_tests=true -Dwith_rpc=true
meson compile -C bbdir
meson test -C bbdir --suite cpmd --print-errorlogs
pixi run -e rpctest python tests/rpc_integ.py --server-bin ./bbdir/CppCore/potserv --cpmd-smoke

See CppCore/rgpot/CPMDPot/README.md; the engine (libcpmdc) is built by the split cpmdc project, not by rgpot.