Skip to content

tests/.clang-tidy (and nine copies) name the wrong Catch2 version for the clang-tidy job #667

Description

@Yaraslaut

tests/.clang-tidy's header states, as a fact a reader is meant to rely on:

The clang-tidy-diff job installs ubuntu-24.04's catch2, 3.4.0, which
predates that comment -- which is why the finding reaches CI here and not on
a workstation with a current Catch2.

(The same sentence is repeated in examples/bank/tests/.clang-tidy and, per
scripts/check_rung_filters.sh, in the eight other examples/*/tests/
copies.)

The version is wrong. The runner's Catch2 is in the 3.5.x series.

Verification status

Measured from CI's own artifact, not reproduced by installing the package.
The clang-tidy-report artifact of run 35581623269 (PR #665, head
aa84b126) prints the runner's headers verbatim:

/usr/include/catch2/internal/catch_test_registry.hpp:121:35: note: expanded from macro 'INTERNAL_CATCH_TESTCASE'
  121 |         INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( dummyFunction ) )

dummyFunction exists only inside
#ifdef CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT, which Catch2 did
not have in 3.4.0 — it arrives in 3.5.0. In 3.4.0 the same macro names the
function CATCH2_INTERNAL_TEST_. A 3.4.0 runner could not print that line.

Three further line numbers in the same artifact match Catch2 3.5.3 exactly
(checked against the v3.5.3 tarball): catch_test_macros.hpp:142 is
#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ ), and
catch_unique_name.hpp:12/13/15 are ..._LINE2 / ..._LINE /
INTERNAL_CATCH_UNIQUE_NAME.

Not verified: the exact package version. One line does not match 3.5.3 —
the artifact renders catch_test_registry.hpp:121 without the
, __VA_ARGS__ that upstream 3.5.3 carries there, so it may be a
distribution patch or a neighbouring 3.5.x point release. "3.5.x" is as far
as the evidence goes; apt-cache policy catch2 on an ubuntu-24.04 runner
would settle it in one line.

Why it is worth fixing rather than shrugging at

The sentence is not decoration: it is the stated reason a suppression exists,
and the reason a workstation is expected to disagree with CI. #666 is about
that disagreement being real and silent; this ticket is about the record of it
naming the wrong version, which is the first thing anyone chasing #666 would
try to reproduce against.

What would change the verdict

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

    area: ciSubsystem: cibugSomething isn't workingdocumentationImprovements or additions to documentationtriage: invalidPremise is false

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions