Convert FORM tests to use Cetmodules#168
Conversation
There was a problem hiding this comment.
Pull request overview
This PR converts the FORM test suite from manually configured executables to use the Cetmodules testing framework (cet_test()). The changes enable parallel test execution by accepting a configurable output file path as a command-line argument, and properly establishes test dependencies to ensure the writer test completes before the reader test runs.
- Refactored writer.cpp and reader.cpp to accept filename as a command-line argument
- Converted CMakeLists.txt to use
cet_test()instead ofadd_executable()andadd_test() - Configured tests to use
CMAKE_CURRENT_BINARY_DIRfor output files to support parallel execution
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/form/writer.cpp | Modified main() to accept and use filename argument instead of hardcoded "toy.root" |
| test/form/reader.cpp | Modified main() to accept and use filename argument instead of hardcoded "toy.root" |
| test/form/CMakeLists.txt | Converted test configuration from manual add_executable/add_test to cet_test() framework with proper dependencies and arguments |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #168 +/- ##
==========================================
- Coverage 81.42% 81.13% -0.30%
==========================================
Files 115 115
Lines 2046 2046
Branches 330 330
==========================================
- Hits 1666 1660 -6
- Misses 252 255 +3
- Partials 128 131 +3
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
aolivier23
left a comment
There was a problem hiding this comment.
Looks reasonable to me. Thank you for doing this! I'm trusting that cet_test() does roughly what the old CMake code did as I'm not familiar with how the cet macros work.
gemmeren
left a comment
There was a problem hiding this comment.
Thanks Chris, looks good.
- Convert test/form tests to use cet_test(). - Update writer.cpp and reader.cpp to accept filename argument. - Pass shared data file path to tests to support parallel execution. Run `cmake-format` (FORM)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1d9f5fe to
13b9738
Compare
|
@aolivier23 @gemmeren I have rebased against main and addressed the remaining (not auto-resolved) comment from Copilot; I'd appreciate a re-review when you have a moment. @aolivier23 Yes, |
aolivier23
left a comment
There was a problem hiding this comment.
Looks good to me. Thank you for confirming about what cet_test() does and great work!
gemmeren
left a comment
There was a problem hiding this comment.
Thanks Chris, looks good.
knoepfel
left a comment
There was a problem hiding this comment.
@greenc-FNAL, can the .devcontainer changes be backed out?
Absolutely (sorry), but I'll need one more approving review. |
13b9738 to
5c73323
Compare
Convert test/form tests to use cet_test().
Update writer.cpp and reader.cpp to accept filename argument.
Pass shared data file path to tests to support parallel execution.
Run
cmake-format(FORM)