unit_test : help text says unknown args are "ignored" but they cause EXIT_FAILURE #1939

issue Anshikakalpana opened this issue on September 21, 2026
  1. Anshikakalpana commented at 6:40 AM on September 21, 2026: contributor

    The help text in src/unit_test.c states:

    Unknown arguments are reported but ignored.

    However, parse_arg() returns -1 when it encounters an unknown key:

    /* Unknown key: report just so typos don't silently pass. */
    fprintf(stderr, "Unknown argument '-%s=%s'\n", key, value);
    return -1;
    

    This propagates through read_args() and causes tf_init() to return EXIT_FAILURE, terminating the program before any tests run.

    Windows/MSVC build):

    > tests.exe --typo=1
    Unknown argument '-typo=1'
    > echo $LASTEXITCODE
    1
    

    vs. a valid argument, which runs normally:

    > tests.exe -i=1
    ...
    Total execution time: 38.234 seconds
    > echo $LASTEXITCODE
    0
    

    Given the comment in parse_arg() ("report just so typos don't silently pass"), the fail-fast behavior looks intentional — in which case the fix is just updating the help text. But I wanted to check before opening a PR: should the documentation be corrected to match the actual (fail-fast) behavior, or should the behavior be changed to match the documented "ignored" claim.

  2. Anshikakalpana renamed this:
    src/unit_test.c: help text says unknown args are "ignored" but they cause EXIT_FAILURE
    unit_test : help text says unknown args are "ignored" but they cause EXIT_FAILURE
    on Sep 21, 2026
  3. theStack commented at 4:32 PM on September 22, 2026: contributor

    Thanks for raising this issue!

    The PR introducing the unit test framework initially ignored unknown arguments and switched to failing later (see related review comments #1734 (review) ff. and #1734#pullrequestreview-3284918572), so keeping the behavior and adapting the help text seems more reasonable. Feel free to open a small PR, happy to review.

  4. real-or-random closed this on Sep 25, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-28 09:33 UTC