test: Add option to only build matching unittests
As we have a lot of unit tests, I find it convenient to only enable some of them during developement. This can be done like this with this PR:
cmake .. -D ACTS_BUILD_ONLY_MATCHING_UNITTESTS="ActsUnitTestGeo.*"
This will only build unit tests that match the pattern (regex).
Could you provide some more details on a use-case? During my development, only 1 unit test changes and needs to be recompiled. Then I only execute that one.
edit: after discussion with @benjaminhuth, possible cases are:
- switching between branches
- fetching unrelated changes
📊: Physics performance monitoring for 8451934c0d13cc86391fae87813149b4b789e03d
physmon summary
- ✅ CKF truth_smeared
- ✅ IVF truth_smeared
- ✅ AMVF truth_smeared
- ✅ Track Summary CKF truth_smeared
- ✅ Seeding truth_estimated
- ✅ CKF truth_estimated
- ✅ IVF truth_estimated
- ✅ AMVF truth_estimated
- ✅ Track Summary CKF truth_estimated
- ✅ Seeding seeded
- ✅ CKF seeded
- ✅ IVF seeded
- ✅ AMVF seeded
- ✅ AMVF (+grid seeder) seeded
- ✅ Track Summary CKF seeded
- ✅ Seeding orthogonal
- ✅ CKF orthogonal
- ✅ IVF orthogonal
- ✅ AMVF orthogonal
- ✅ Track Summary CKF orthogonal
- ✅ Ambisolver seeded
- ✅ Ambisolver orthogonal
- ✅ Seeding ttbar
- ✅ CKF ttbar
- ✅ Ambisolver
- ✅ Track Summary CKF ttbar
- ✅ AMVF ttbar
- ✅ AMVF (+grid seeder) ttbar
- ✅ Truth tracking (GSF)
- ✅ Truth tracking
- ✅ Truth tracking (GX2F)
- ✅ Particles fatras
- ✅ Particles geant4
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 47.59%. Comparing base (
2e0ebfe) to head (8451934). Report is 455 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3233 +/- ##
==========================================
- Coverage 49.14% 47.59% -1.55%
==========================================
Files 499 507 +8
Lines 29253 29135 -118
Branches 13870 13976 +106
==========================================
- Hits 14375 13866 -509
- Misses 4969 5268 +299
- Partials 9909 10001 +92
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
How do we proceed with this? My proposal is to just use something like
ninja -t targets | sed 's/:.*//g' | grep "ActsUnitTest.*" | xargs ninja
locally instead of adding this functionality to the cmake configuration.
If we converge to use the regex targets, I would like to have a line in the documentation mentioning it.
I guess one advantage of using CMake for this is that you do not have to explicitly build tests with ninja and the all target will just by default only build the tests which match. It reminds me a bit of the Athena mechanism to select packages to build. Maybe that would also be an option so we can have + and - listings. But that might be over-engineering
I would be fine closing this, since most people seem fine with using ninja + regex, and this should also work fine for me. In the spirit "the less build system code the better".
Adding a mechanism to do module selection with + / - listings sounds way to overengineered to me.
If we contain it to the unit test macro + top level CMake option (so avoid having the extra ifs in the config) I'm on board with this. I also would stick to a single regex you supply with a single option.
Let's close it for now, I don't have the motivation currently to make this clean. If I ever feel like needing this in the future, I can still reopen it.