BNMR: Tests
There are several levels of tests available for bnmr and bnqr software.
Automated tests that don't use the ODB
Tests of the core cycling_framework
, bnxr_common
extensions to the framework, and MUD logging code are built alongside the main executables.
These test programs can be run on a development system or the real system, and 'do not interact with the midas ODB at all. They are safe to run at any time.
bin/unit_tests/RUN_ALL_CORE_TESTS_32bit.exe
runs tests of the corecycling_framework
bin/unit_tests/RUN_ALL_BNXR_HISTO_TESTS_32bit.exe
runs tests of the histogramming code inbnxr_common
bin/unit_tests/RUN_ALL_BNXR_LOGGING_TESTS.exe
runs tests of the MUD logging code
If any of these test fail, you must investigate and fix the issue!
The code for the core tests is in cycling_framework/unit_tests
and the other tests are in bnxr_common/tests
.
Automated tests that do use the ODB
Several python scripts exist that test the calculations performed by various programs. These set some values in the ODB, run the computations, then check the computed values against the expected output.
These test programs are safest to run on a development system rather than the real system. If running on the real system, note that whenever the tests change mode, the test ODB settings will be saved to disk! It is suggested that you make a backup of the json files in ~/online/Mode
before running these programs, then restore the contents afterwards!
bnxr_common/tests/test_ppg_calc.py
tests the full chain of ODB → RF calculator → PPG compiler for various modes, but doesn't actually load anything onto the PPG. The RF calculator and PPG compiler do NOT need to be running.bnxr_common/tests/test_psm_calc.py
tests the full chain of ODB → RF calculator → ODB for various modes, but doesn't actually load anything onto the PSM. The RF calculator does NOT need to be running.bnxr_common/tests/test_mud_logging.py
pretends to be the frontend and sends data to midas banks that are read by the . The frontend should NOT be running, but the bnxr_logger.exe SHOULD be running!
Running the frontend on a dev system without real hardware
The frontend can be compiled on a development system that doesn't have hardware attached and has no VME libraries or EPICS libraries available. Do this by passing the -DDUMMY_MODE=1
flag to cmake.
cd build cmake .. -DUMMY_MODE=1 -DEXP=BNMR make install
You can then run the frontend on your own midas experiment and verify that cycles start, histograms increment etc. Various failure modes can be simulated during these runs, including "constant time" failures, bad helicity flips and empty bins from the scalers.