Skip to content

Conversation

@tautschnig
Copy link
Collaborator

Previously, when the option was used with a function name that matched an existing function that already had a body, the error message incorrectly stated "No function name matched regex", which confused users into thinking their regex was wrong when in fact the function was found but had an existing body.

The fix improves user experience by providing clear, actionable error messages that distinguish between:

  • Functions that don't match the provided regex
  • Functions that match the regex but already have bodies (and thus cannot have bodies generated)

Fixes: #2974

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig force-pushed the fix-2974-generate-function-body-warning branch from c359c35 to 7893fc0 Compare November 30, 2025 21:17
… bodies

Previously, when the option was used with a function name that matched
an existing function that already had a body, the error message
incorrectly stated "No function name matched regex", which confused
users into thinking their regex was wrong when in fact the function was
found but had an existing body.

The fix improves user experience by providing clear, actionable error
messages that distinguish between:

- Functions that don't match the provided regex
- Functions that match the regex but already have bodies (and thus
  cannot have bodies generated)

Fixes: diffblue#2974
@tautschnig tautschnig force-pushed the fix-2974-generate-function-body-warning branch from 7893fc0 to 5a1e105 Compare November 30, 2025 21:43
@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

❌ Patch coverage is 73.68421% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.94%. Comparing base (4fe3ade) to head (5a1e105).

Files with missing lines Patch % Lines
src/goto-instrument/generate_function_bodies.cpp 73.68% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8786   +/-   ##
========================================
  Coverage    79.93%   79.94%           
========================================
  Files         1698     1698           
  Lines       187698   187703    +5     
  Branches        73       73           
========================================
+ Hits        150034   150053   +19     
+ Misses       37664    37650   -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Generate function body returns misleading error message

3 participants