Skip to content

fix: make BaseTest properly handle tests which return skipped return code

Christoph Hasse requested to merge chasse/Gaudi:chasse_skip_test into master

Prior to this patch, tests could at runtime call sys.exit(77) and the test would later be considered by CTest as skipped.

But the BaseTest didn't know about a special return code to signal "skipping" which resulted in two problems:

  1. The validation would still be called on tests that were supposed to be skipped. This could lead to creating new but empty ref files for tests.
  2. The test would be treated as "failed" in BaseTest which results in wrong debug output. (The failed status is only later turned into "notrun" by CTest)

This MR introduces a variable SKIP_RETURN_CODE which can be imported as from GaudiTesting import SKIP_RETURN_CODE and makes the BaseTest correctly handle tests which return this special code.
A test is added to GaudiExamples showcasing the usage and the test itself asserts that the validator of skipped tests isn't called.

Merge request reports

Loading