# Tests The unit and integration tests are written with [Catch2](https://github.com/catchorg/Catch2) and collected into a single binary, `tests/jfjoch_test`. Build and run it with: ``` make -j$(nproc) jfjoch_test cd tests ./jfjoch_test # everything ./jfjoch_test "" # one test case ./jfjoch_test "[tag]" # by tag ``` There are also benchmark and hardware routines, each printing its own usage: * `jfjoch_hdf5_test` to measure HDF5 dataset writing speed (single threaded). It doubles as the generator of the HDF5 files used by the external-software tests below. * `jfjoch_lite_perf_test` to measure the CPU/GPU ("lite") analysis path - indexing, integration and optional file writing. * `jfjoch_fpga_test` to test quality/performance of FPGA card(s) and software routines. With `-H` it runs the high-level-synthesis C model on the CPU, so no FPGA device is needed. Out-of-space handling is covered separately by `jfjoch_hdf5_enospc_test`, run under the `enospc_shim` `LD_PRELOAD` module that makes writes fail with `ENOSPC`. In addition, tests are executed to verify that datasets written by Jungfraujoch are readable by other MX software (see [Integration with MX data processing software](SOFTWARE_INTEGRATION.md)) - XDS through the Jungfraujoch, Durin and Neggia plugins, and DIALS `xia2.ssx` - for each of the NXmx layouts. Input files for these programs are placed in the `tests/xds`, `tests/xds_durin`, `tests/xds_neggia` and `tests/crystfel` folders. See `.gitea/workflows/build_and_test.yml` for the exact commands; the CrystFEL fixtures are run by hand rather than in the pipeline.