Skip to content

Add test build of public headers

picked up from https://gitlab.cern.ch/clemenci/Gaudi/tree/GAUDI-1231.add-test-build-of-all-headers .

Adds a target test_headers_build (well, replaces an existing one with the same name if I saw that correctly now). That itself depends on many test_headers_build_${library}. It's not included in the all target, so the test only runs when doing cmake --build $BUILDDIR --target test_headers_build. There's also a switch GAUDI_ALL_TEST_HEADERS_BUILD to include it in the all target.

For each public header a small .cpp is created (one line, just include the header, and add an IWYU pragma for the future if IWYU will be run on these headers to avoid IWYU complaining about the one-liner-files … although the iwyu on /cvmfs/lhcb.cern.ch shouldn't do that … the upstream one might due to associated header treatments …) and compiled.

EDIT: just realised it's important to point out that only public headers are tested. non-public headers (even if they are in SUBMODULE/SUBMODULE/*.h and not SUBMODULE/src/*.h) remain untested (just got confused about that).

Edited by Paul Seyfert

Merge request reports