feat: add unit/integration tests for tools and geocad and run them in linux-eic-shell CI#52
feat: add unit/integration tests for tools and geocad and run them in linux-eic-shell CI#52Copilot wants to merge 5 commits into
Conversation
Agent-Logs-Url: https://github.com/eic/npsim/sessions/b521889f-8464-4586-9c5e-cad93db018f9 Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
|
@copilot Wire the testing into the linux-eic-shell CI workflow as part of the build job matrix. DD4hep and OpenCascade will be available (enable GEOCAD build option if not already enabled). |
Agent-Logs-Url: https://github.com/eic/npsim/sessions/521280b1-bee0-40cd-9c14-d1d77a96b1c1 Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Updated in |
Agent-Logs-Url: https://github.com/eic/npsim/sessions/c4b5c244-df29-484e-8c4c-3ec21cc984a8 Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
…put test WILL_FAIL TRUE fails when npdet_to_step exits with code 0 (ROOT atexit handlers override return 1 from main). Use PASS_REGULAR_EXPRESSION to verify the error message is printed instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capybara summary for PR 52
|
There was a problem hiding this comment.
Pull request overview
Adds unit and integration tests for the npdet_to_step CLI tool and the GeoCad library, refactors npdet_to_step.cxx to separate CLI parsing into its own translation unit, and wires the new tests into the linux-eic-shell CI workflow (with -DUSE_GEOCAD=ON and a ctest step).
Changes:
- Refactor: split argument parsing out of
npdet_to_step.cxxintonpdet_to_step_cli.{h,cxx}and move the.stp-suffix helper intosettings.hasensure_step_extension. - New tests:
unit_settings,tools_integration_npdet_to_step_help/_missing_inputfor tools;unit_partial_treeandintegration_create_stepfor geocad. - Build/CI: hoist
include(CTest)to top-level CMake, wiretests/subdirectories underBUILD_TESTING, enableUSE_GEOCADand runctestin the eic-shell workflow.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Add top-level include(CTest) to enable testing globally. |
| .github/workflows/linux-eic-shell.yml | Configure with -DUSE_GEOCAD=ON, build, then run ctest before install. |
| src/tools/CMakeLists.txt | Add npdet_to_step_cli.cxx to executable and add tests subdir under BUILD_TESTING. |
| src/tools/src/npdet_to_step.cxx | Slim main(); delegate parsing to cmdline_settings and use new ensure_step_extension helper. |
| src/tools/src/npdet_to_step_cli.{h,cxx} | New TU containing CLI parsing/help-page logic extracted from npdet_to_step.cxx. |
| src/tools/src/settings.h | Add inline ensure_step_extension helper for .stp suffix handling. |
| src/tools/tests/CMakeLists.txt | Replace simple Catch test with unit_settings and two npdet_to_step integration tests using PASS_REGULAR_EXPRESSION. |
| src/tools/tests/unit_settings.cxx | Unit test for ensure_step_extension covering several filename shapes. |
| src/tools/tests/simple.cxx | Remove obsolete Catch-based placeholder test. |
| src/geocad/CMakeLists.txt | Add tests subdir under BUILD_TESTING. |
| src/geocad/tests/CMakeLists.txt | Define unit/integration test executables linked against GeoCad and register add_test. |
| src/geocad/tests/unit_partial_tree.cxx | Exercise TOCCToStep::OCCPartialTreeCreation on a synthetic TGeo tree. |
| src/geocad/tests/integration_create_step.cxx | Build a synthetic TGeo geometry, run TGeoToStep::CreateGeometry, and verify a non-empty .stp file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds unit and integration tests for the
npdet_to_stepgeometry tool and theGeoCadlibrary, and wires them into thelinux-eic-shellCI workflow.Changes
CI (
.github/workflows/linux-eic-shell.yml)-DUSE_GEOCAD=ONin the cmake configure step so the geocad library and its tests are builtctestin the build matrix before installing, with--output-on-failureand--no-tests=errorBuild system
include(CTest)to the top-levelCMakeLists.txt(required foradd_testto work correctly)npdet_to_steptool (src/tools/)npdet_to_step.cxxintonpdet_to_step_cli.cxx/npdet_to_step_cli.hto separatemain()from the parsing logicsettingshelpers (unit_settings.cxx): verifiesensure_step_extensionhandles various filename inputstools_integration_npdet_to_step_help: verifies the help subcommand prints the expected descriptiontools_integration_npdet_to_step_missing_input: verifies an appropriate error message is printed when a non-existent compact file is supplied (usesPASS_REGULAR_EXPRESSIONrather thanWILL_FAILto avoid the CTest property-inversion issue when combining those two properties)GeoCad library (
src/geocad/)unit_partial_tree.cxx)integration_create_step.cxx)