Skip to content

Link optional fbasics tests with abort recovery support - #180

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:mainfrom
sylvesterkaczmarek:fix/fbasics-test-abort-support
Open

sylvesterkaczmarek wants to merge 1 commit into
nasa:mainfrom
sylvesterkaczmarek:fix/fbasics-test-abort-support

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

Fixes #174.

Link the optional fb_core_test target to cea_abort_support when the C bindings are enabled, matching the existing cea_core_test linkage. Keep this CEA-specific dependency beside the other recovery-support links rather than adding it to the vendored fbasics target definition.

Changes

  • Guard the link with if(TARGET fb_core_test) so builds without the optional tests remain unchanged.
  • Enable and build fb_core_test in the existing pFUnit CI job. The following CTest step runs it with the other tests.

Testing

On macOS arm64 with GNU Fortran 14.2 and CMake 4.3:

  • The unmodified core-c build with CEA_BUILD_TESTING=ON and FB_BUILD_TESTING=ON fails to link fb_core_test with the two reported cea_bindc_abort_* undefined symbols.
  • The patched target builds and all 28 fbasics test cases pass.
  • The complete core-c build and all 16 CTest targets pass, including the CEA core, CLI and C-binding tests.
  • A separate configuration with both test options OFF builds the CLI and passes its -h smoke test.
  • actionlint and git diff --check pass. Independent source review found no actionable defects.

Windows/Intel compiler validation was not run locally. This change covers the reported C-bindings-enabled configuration; it does not redesign existing recovery-support linkage for standalone fbasics or C-bindings-disabled builds.

Compatibility / Numerical behavior

  • No expected changes to numerical results

No solver, Fortran implementation, thermodynamic inputs or transport inputs are changed.

Independent platform verification

@djkees confirmed the linkage on Windows 11 with gfortran 16.1 in the same C bindings/testing configuration. Their fork's Linux GCC 11 pFUnit job built and passed fb_core_test and all 15 other CTest targets. On Windows, the existing USER/USERNAME assumption and E-12 versus E-012 exponent formatting in the test code cause two unrelated test failures; the optional test now links and runs. These platform observations were supplied by the contributor and were not independently executed on my machine.

@djkees

djkees commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for taking this on. I confirmed it on Windows 11 with gfortran 16.1 (conda-forge), the configuration from #174: with core-c, CEA_BUILD_TESTING=ON and FB_BUILD_TESTING=ON, fb_core_test now builds and links. I also ran the branch through CI on my fork, where the Linux gcc 11 pFUnit job builds and passes fb_core_test along with the other 15 CTest targets.

Running it on Windows exposed two problems in the existing tests, neither caused by this change. test_getenv expects a USER variable (Windows sets USERNAME), and the run stops there unless USER is set. With USER set, 27 of 28 cases pass, and test_to_from_str fails because it expects E-12 where Windows prints E-012. Anyone on Windows who wants to look at those is welcome to.

Drafted with Claude's assistance

  • Built the PR branch and ran fb_core_test locally on Windows as above
  • Checked the CI step log on my fork for the fb_core_test pass

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review November 7, 2026 08:44
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Thanks for the independent Windows and Linux verification, @djkees. It is particularly helpful to know the optional fbasics target now links in the Windows configuration from #174. I've included your findings in the PR description and marked the change ready for review. The existing USER/USERNAME and exponent-format test differences appear separate from this CMake linkage fix, so I'll keep them out of its scope. Appreciate you testing the branch.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] fb_core_test fails to link with FB_BUILD_TESTING=ON (missing cea_abort_support)

2 participants