Skip to content

[tmva][sofie] Don't compile emitted code for testing at build time #19370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 15, 2025

Conversation

guitargeek
Copy link
Contributor

Following a discussion with @lmoneta and @sanjibansg.

Don't compile emitted code for testing at build time, but use the convenient ROOTTEST macros to define the right sequence of emitting code, building, and testing.

Closes #18554.

To make this easier, move the ROOTTEST macros to the global RootMacros.cmake file, which should be fine now that the repositories are merged anyway. What do you think, @pcanal and @linev?

Now that the repositories are merged, it makes sense to also make the
roottest macros available in all of ROOT, so that they can also be used
by tests outside of the roottest directory where convenient.
Use relative path to source dir for roottest names fallback if
`ROOTTEST_DIR` is not defined.
@guitargeek guitargeek self-assigned this Jul 14, 2025
@guitargeek guitargeek requested a review from bellenot as a code owner July 14, 2025 23:35
@guitargeek guitargeek added in:Build System in:TMVA clean build Ask CI to do non-incremental build on PR labels Jul 14, 2025
Copy link

Test Results

    21 files      21 suites   3d 13h 41m 36s ⏱️
 3 210 tests  3 209 ✅ 0 💤 1 ❌
65 669 runs  65 668 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 574ed1e.

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I believe this is the good approach! The setup with the FIXTURES macros is not polished yet, I left some suggestions

@guitargeek
Copy link
Contributor Author

Thanks for the review! You are right, fixtures are clearer than the magic DEPENDS ${GENERATE_EXECUTABLE_TEST}

Don't compile emitted code for testing at build time, but use the
convenient ROOTTEST macros to define the right sequence of emitting
code, building, and testing.

Closes root-project#18554.
@guitargeek guitargeek requested a review from vepadulano July 15, 2025 11:10
Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one small remark

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One general comment regarding the change in the build system. Note that even though roottest got merged into root we still have the build option roottest which could be OFF. In that case, the ROOTTEST macros being defined inside RootMacros.cmake might result in missing variables or anything wrong with the cmake. Probably this should be evaluated

@guitargeek guitargeek requested a review from lmoneta as a code owner July 15, 2025 11:47
@guitargeek
Copy link
Contributor Author

Good question! I checked to build and run the tests with roottest=OFF, and it all works 👍

Also I added one more commit to fix an unused variable warning.

@dpiparo dpiparo self-requested a review July 15, 2025 12:23
@guitargeek guitargeek merged commit 13c6b71 into root-project:master Jul 15, 2025
24 of 25 checks passed
@guitargeek guitargeek deleted the build_sofie_tests branch July 15, 2025 13:59

#-------------------------------------------------------------------------------
#
# Former RoottestMacros.cmake starts here
Copy link
Member

@pcanal pcanal Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have found it much clearer to just move the file as is .... even if it was then 'included' here ....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the commit history maybe, but my hope was that by bringing these files together, more code duplication will be apparent and inspire code improvements along the way in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean build Ask CI to do non-incremental build on PR in:Build System in:TMVA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spurious TMVA related rebuild
4 participants