Skip to content
  • Will Chandler's avatar
    lint: Detect missing TestMain in _test packages · 65c380dd
    Will Chandler authored
    With 3adbbfb5 (lint: Add linter for testhelper.Run, 2023-08-24) we
    added a linter to detect if a package did not contain a `TestMain`
    function. This was limited to checking non-test packages as each
    analysis pass is self-contained and does not allow us to
    cross-reference another package.
    
    To allow us to reliably detect when a primary package does not have
    tests, but its `_test` package does, start exporting a
    `testhelperFact` that indicates if a package has a `TestMain` function.
    When analyzing a `_test` package, we can import the fact of its related
    package and prevent false positives.
    65c380dd