Skip to content

[bug] find_package(PFUNIT) is not REQUIRED — cea_core_test is silently skipped if the GFE prerequisite is missing #97

Description

@djkees

Summary
Top-level CMakeLists.txt:56 calls find_package(PFUNIT) without REQUIRED, and source/CMakeLists.txt:33 only registers the core Fortran test suite when both flags are set:

if(CEA_BUILD_TESTING AND PFUNIT_FOUND)
    add_pfunit_ctest(cea_core_test ...)
endif()

CEA_BUILD_TESTING defaults to ON (CMakeLists.txt:54, ${PROJECT_IS_TOP_LEVEL}) and none of the dev* CMake presets override it, so CONTRIBUTING.md's documented quickstart — cmake --preset dev then cd build-dev && ctest — looks like it should "just work." But if the separate GFE/pFUnit prerequisite step (also documented in CONTRIBUTING.md, under "Running Tests") wasn't completed first, PFUNIT_FOUND is false, cea_core_test is never registered, and ctest reports success with zero core tests run and no warning that anything is missing.

Reproduction

  • Interface: Fortran (CMake/ctest configuration)
  • Steps: cmake --preset dev in a checkout without GFE set up under extern/, then cmake --build build-dev && cd build-dev && ctest. Reports "No tests were found" or a passing/empty run rather than an actionable error.

Expected behavior
Either find_package(PFUNIT REQUIRED) at the top level (failing configure loudly when CEA_BUILD_TESTING=ON and pFUnit isn't found), or an explicit message(WARNING ...) / message(FATAL_ERROR ...) in source/CMakeLists.txt when CEA_BUILD_TESTING is on but PFUNIT_FOUND is false, so a missing prerequisite fails visibly instead of silently producing an empty test suite.

Actual behavior
Silent skip; ctest reports success either way.

Environment

  • OS: n/a (source-level, CMake configuration)
  • CEA version/commit: current branch as of 2026-09-01

Additional context
Related to #53 (CONTRIBUTING.md and developer_guide.rst give two different, non-reconciled procedures for this same GFE/pFUnit prerequisite) — that issue is about the instructions being contradictory; this one is about the build silently tolerating the prerequisite being skipped altogether, which is what makes following the wrong instructions in #53 easy to miss.


Drafted with Claude's assistance

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: highCorrectness/CI-trust issue, or tied to a confirmed real bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions