Fail visibly when CEA_BUILD_TESTING is on but pFUnit is missing - #152
Open
djkees wants to merge 2 commits into
Open
Fail visibly when CEA_BUILD_TESTING is on but pFUnit is missing#152djkees wants to merge 2 commits into
djkees wants to merge 2 commits into
Conversation
Previously cea_core_test was silently skipped and ctest reported success with zero tests. Now a configure-time warning fires and a WILL_FAIL placeholder test surfaces the gap in ctest's own result too. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* Build GFE/pFUnit on Windows bindc CI legs * Disable CEA_BUILD_TESTING on Windows bindc CI legs instead of building GFE
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.
Summary
CEA_BUILD_TESTING=ON(the default for top-level builds) silently registered zero Fortran unit tests when the GFE/pFUnit prerequisite wasn't set up, andctestreported success anyway. Originally reported at djkees#97.Changes
In
source/CMakeLists.txt, whenCEA_BUILD_TESTINGis on butPFUNIT_FOUNDis false:message(WARNING ...)at configure time pointing to CONTRIBUTING.md's "Running Tests" prerequisite steps.cea_core_test_pfunit_missingplaceholder test markedWILL_FAIL TRUE, soctest's own exit code reflects the missing prerequisite instead of reporting a clean pass with zero tests run.find_package(PFUNIT REQUIRED)was considered but rejected:CEA_BUILD_TESTINGalso gatescea_main_test(the CLI smoke test), which needs no pFUnit at all, so making itREQUIREDwould force every top-level dev build to set up GFE just to run the CLI tests.Testing
CEA_BUILD_TESTING=ONand no GFE/pFUnit installed (gfortran/Ninja via a conda toolchain): confirmed the newmessage(WARNING ...)fires atsource/CMakeLists.txt.ctest -R pfunit_missing --output-on-failure: confirmedcea_core_test_pfunit_missingfails with the intended message and a non-zero exit code (previouslyctestwould have reported 0 tests / success).PFUNIT_FOUND=TRUEbranch directly (no local pFUnit/GFE install in this environment) — that branch is unmodified by this change, so behavior there is unaffected by inspection.Compatibility / Numerical behavior
Drafted with Claude's assistance
CMakeLists.txtandsource/CMakeLists.txtbefore and after the change.