Skip to content

Introduce new I/O helpers, new I/O tests, and a 'loglevel' to steer the verbosity; and remove old cmake options

Riccardo Maria Bianchi requested to merge io-test-tools into main

This MR introduces new I/O helpers to write and load a .db file. This is introduced with a new subpackage in GeoModelIO: GeoModelIOHelpers.

This MR merges the old-standing branch in #62 (closed)

The MR also adds new I/O test helper functions, and examples that compare/count occurrences of different shared GeoModel nodes. All sharable nodes have been considered: shapes, logVols, PhysVols, and so forth.

The MR also adds a new way to set the log level for the I/O operations. So far, the verbosity of Write/Read operations was handled with two methods: CMake options that introduced compilation flags that were picked by the preprocessor to define variables and env vars that set verbosity level at the terminal level.

With these changes, I remove the CMake options, which are not convenient, and I introduce a setLogLevel(unsigned) method to the Write and Read classes, to set the verbosity level from the code.

This was needed while coding the new test routines that test the I/O operations.

The environment variables now set/overwrite the log level set through code. In this way, developers can set a default value and then overwrite it temporarily when running a piece of code.

Edited by Riccardo Maria Bianchi

Merge request reports