[roottest] Fix test dependencies using fixtures#21708
Merged
hageboeck merged 3 commits intoroot-project:masterfrom Mar 27, 2026
Merged
[roottest] Fix test dependencies using fixtures#21708hageboeck merged 3 commits intoroot-project:masterfrom
hageboeck merged 3 commits intoroot-project:masterfrom
Conversation
Test Results 22 files 22 suites 3d 8h 18m 49s ⏱️ Results for commit eefc996. ♻️ This comment has been updated with latest results. |
4 tasks
When COMPILE_MACRO was a macro, setting test fixtures broke variables such as ARG_FIXTURES_REQUIRED in the "calling" macro or function, because macro invocations overwrite variables in the current scope. By making it a function, local definitions don't affect the calling code.
…ent. Many setup macros or reflex dictionaries were added to ROOTTEST tests using DEPENDS. This is, however, only an order relationship. If the setup tests are selected, they run before the main test. However, if they are not selected (e.g. due to --rerun-failed or -R xxx), the setup tests won't run. Here, reflex dictionaries and macro compilation are all marked with FIXTURES_SETUP, so they are understood by CMake as tests that run some kind of setup. When ROOTTEST_ADD_TEST is used with DEPENDS <testname>, the setup fixture names from all dependencies (dictionaries or macros) are read and added to the test with FIXTURES_REQUIRED. This leads CTest to start these tests before starting the main tests, even if they are not selected.
The "readNew" test reads an old file with a new class definition. By mistake, its fixture was however causing the creation of the root file with the new class version that is used in a different test.
c78e0c6 to
eefc996
Compare
guitargeek
approved these changes
Mar 27, 2026
Contributor
guitargeek
left a comment
There was a problem hiding this comment.
Thank you, very nice!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running a subset of tests in roottest, one can end up in a forever-broken state when using
ctest --rerun-failed. This is caused by test dependencies being specified withDEPENDSinstead of using a test fixture.DEPENDSis order only, so it does not start the tests that a selected test depends on.In pseudo-CMake:
The order is stable. But:
And with fixtures:
Because of the above, this PR labels every macro compilation triggered by
DEPENDS <macro>and every reflex dictionary generation with an automatic fixture name:Subsequently, in ROOTTEST_ADD_TEST, all DEPENDS arguments are scanned for these fixtures, and if found, they are added as
FIXTURES_REQUIREDto the test being defined. This should fix the problem described above.Furthermore, there was a typo in a fixture name that was corrected.
Lastly,
ROOTTEST_COMPILE_MACROwas converted into a function. As a macro, its local variables were overriding the fixture names of the calling code.