Skip to content

Make pfn compile-fail tests readable - #461

Merged
Bronek merged 1 commit into
mainfrom
bronek/refactoring_death_tests
Oct 17, 2026
Merged

Bronek merged 1 commit into
mainfrom
bronek/refactoring_death_tests

Conversation

@Bronek

@Bronek Bronek commented Oct 17, 2026

Copy link
Copy Markdown
Member

Restructures the compile-fail tests from #459 so they can be read top to bottom. Each scenario is a named #ifdef LIBFN_REJECT_<scenario> block in tests/pfn/reject/, right after a positive control that differs only in what makes it fail. CMake reads the guards from each source: the source must build as is, and each guard becomes a WILL_FAIL test named after it. Coverage is unchanged at 41 scenarios per mode.

Checked locally on gcc 16.2 and clang 22.1: the full suite passes, and against the pfn headers from before #459 all 41 reject tests fail while both sources still build. This PR's CI is the first MSVC run.

Assisted-by: Claude:claude-opus-5-5

Each scenario is a named `#ifdef LIBFN_REJECT_<scenario>` block beside
its positive control, and CMake derives one test per guard.

Assisted-by: Claude:claude-opus-5-5
@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@augmentcode

augmentcode Bot commented Oct 17, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Refactors pfn compile-fail tests for top-to-bottom readability without changing library code.

  • Moves expected and optional rejection tests into tests/pfn/reject/.
  • Replaces numeric preprocessor matrices with named LIBFN_REJECT_ guards.
  • Places positive controls beside their corresponding rejection scenarios.
  • Adds a reusable refusing callback fixture with invocability assertions.
  • Builds each source without rejection guards as a positive-control object target.
  • Discovers and validates scenario guards during CMake configuration.
  • Registers each guarded build as a CTest WILL_FAIL test.
  • Uses a shared resource lock to serialize builds within the test tree.
  • Preserves 41 rejection scenarios per enabled mode and updates contributor guidance and test references.

🤖 Was this summary useful? React with 👍 or 👎

@sonarqubecloud

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@Bronek
Bronek merged commit 3bcfb55 into main Oct 17, 2026
46 checks passed
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.

1 participant