lint: Grep for `AUTO` test suites in file names #35451

pull rustaceanrob wants to merge 1 commits into bitcoin:master from rustaceanrob:26-6-3-tname-lint changing 2 files +6 −6
  1. rustaceanrob commented at 3:59 PM on June 3, 2026: member

    Tests without a fixture did not have their file names linted because the grep matches on BOOST_FIXTURE. Updates to match BOOST_FIXTURE or BOOST_TEST.

  2. DrahtBot added the label Tests on Jun 3, 2026
  3. DrahtBot commented at 3:59 PM on June 3, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35451.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK l0rinc, hebasto, achow101

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. in src/test/CMakeLists.txt:47 in 38ddd8f7d3
      43 | @@ -44,7 +44,7 @@ add_executable(test_bitcoin
      44 |    descriptor_tests.cpp
      45 |    disconnected_transactions.cpp
      46 |    feefrac_tests.cpp
      47 | -  feerounder_tests.cpp
      48 | +  fee_rounder_tests.cpp
    


    l0rinc commented at 12:27 PM on June 4, 2026:

    38ddd8f lint: Grep for AUTO test suites in file names:

    Fixing the suite name would result in a smaller diff:

    -BOOST_AUTO_TEST_SUITE(fee_rounder_tests)
    +BOOST_AUTO_TEST_SUITE(feerounder_tests)
    

    If you insist on the rename, please separate it to a dedicated commit explaining the reasoning.

  5. in test/lint/lint-tests.py:34 in 38ddd8f7d3
      30 | @@ -31,7 +31,7 @@ def check_matching_test_names(test_suite_list):
      31 |      not_matching = [
      32 |          x
      33 |          for x in test_suite_list
      34 | -        if re.search(r"/(.*?)\.cpp:BOOST_FIXTURE_TEST_SUITE\(\1(_[a-z0-9]+)?, .*\)", x) is None
      35 | +        if re.search(r"/(.*?)\.cpp:BOOST_(FIXTURE|AUTO)_TEST_SUITE\(\1(_[a-z0-9]+)?[,)]", x) is None
    


    l0rinc commented at 1:03 PM on June 4, 2026:

    The filename check currently requires a trailing comma because it only sees BOOST_FIXTURE_TEST_SUITE(name, fixture), but BOOST_AUTO_TEST_SUITE(name) doesn't require it anymore.

    Using a character set here for , or ) is a compact choice, and we don't need the search to validate the whole line. 👍

    Since we're fixing it here, we should adjust check_unique_test_names as well:

    -    output = [re.search(r"\((.*?),", x) for x in test_suite_list]
    +    output = [re.search(r"\((.*?)[,)]", x) for x in test_suite_list]
    

    And since we don't need to capture the alternation (unlike the first part, which is referenced later), we can make it non-capturing by prefixing with ?::

            if re.search(r"/(.*?)\.cpp:BOOST_(?:FIXTURE|AUTO)_TEST_SUITE\(\1(_[a-z0-9]+)?[,)]", x) is None
    
  6. l0rinc changes_requested
  7. l0rinc commented at 1:07 PM on June 4, 2026: contributor

    Concept ACK, good find

  8. rustaceanrob force-pushed on Jun 4, 2026
  9. rustaceanrob commented at 1:45 PM on June 4, 2026: member

    Applied feedback in f2aef5ba11d399c0cdbf4c0107ee851f28cf6bb0

  10. l0rinc commented at 1:48 PM on June 4, 2026: contributor

    lightly tested code review ACK f2aef5ba11d399c0cdbf4c0107ee851f28cf6bb0

  11. in test/lint/lint-tests.py:21 in f2aef5ba11
      18 |      command = [
      19 |          "git",
      20 |          "grep",
      21 |          "-E",
      22 | -        r"^BOOST_FIXTURE_TEST_SUITE\(",
      23 | +        r"^BOOST_(FIXTURE|AUTO)_TEST_SUITE\(",
    


    hebasto commented at 2:23 PM on June 4, 2026:

    Using full macro names in the regex will be helpful when grepping for them across the entire codebase.

    For example:https://github.com/bitcoin/bitcoin/blob/47da4f9b716d11294d4fb0f30b04a7bcf128cc14/src/test/CMakeLists.txt#L189-L192

  12. l0rinc approved
  13. lint: Grep for `AUTO` test suites in file names
    Tests without a fixture did not have their file names linted because the
    grep matches on `BOOST_FIXTURE`. Updates to match `BOOST_FIXTURE` or
    `BOOST_TEST`.
    
    Co-authored-by: l0rinc <pap.lorinc@gmail.com>
    f6bdbcf79d
  14. rustaceanrob force-pushed on Jun 5, 2026
  15. rustaceanrob commented at 8:44 AM on June 5, 2026: member

    Use of full names f6bdbcf79d9e4b17ef9fc4e254e4ada789be88a1

  16. l0rinc commented at 8:50 AM on June 5, 2026: contributor

    ACK f6bdbcf79d9e4b17ef9fc4e254e4ada789be88a1

    nit: the PR description likely needs some minor updates

  17. hebasto approved
  18. hebasto commented at 2:55 PM on June 5, 2026: member

    ACK f6bdbcf79d9e4b17ef9fc4e254e4ada789be88a1.

  19. achow101 commented at 9:40 PM on June 10, 2026: member

    ACK f6bdbcf79d9e4b17ef9fc4e254e4ada789be88a1

  20. achow101 merged this on Jun 10, 2026
  21. achow101 closed this on Jun 10, 2026

  22. rustaceanrob referenced this in commit bff05e19eb on Jun 12, 2026
  23. in test/lint/lint-tests.py:64 in f6bdbcf79d
      60 | @@ -61,7 +61,7 @@ def get_duplicates(input_list):
      61 |  
      62 |  
      63 |  def check_unique_test_names(test_suite_list):
      64 | -    output = [re.search(r"\((.*?),", x) for x in test_suite_list]
      65 | +    output = [re.search(r"\((.*?)[,)]", x) for x in test_suite_list]
    


    maflcko commented at 1:28 PM on June 12, 2026:

    What is the point of this duplicate check? Cmake already checks for this, so this duplicate check is redundant and should be removed.


    l0rinc commented at 8:19 PM on June 12, 2026:

    I was wondering the same - seems it was added pre-cmake


    l0rinc commented at 9:13 PM on June 12, 2026:

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-02 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me