From f964db8b105014df6a5bc5d210b8422d92da7964 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:45:07 -0500 Subject: [PATCH 01/11] fix(lexarg): Correct line wrapping --- crates/libtest-lexarg/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index feb1eba..a888dba 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -129,8 +129,7 @@ tests whose names contain the filter are run. Multiple filter strings may be passed, which will run all tests matching any of the filters. By default, all tests are run in parallel. This can be altered with the ---test-threads flag when running -tests (set it to 1). +--test-threads flag when running tests (set it to 1). All tests have their standard output and standard error captured by default. This can be overridden with the --no-capture flag to a value other than "0". From 8b5f5c2eac56db66b4deba67c527059997a56318 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:45:44 -0500 Subject: [PATCH 02/11] fix(lexarg): Remove non-universal help text --- crates/libtest-lexarg/src/lib.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index a888dba..eac571d 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -130,25 +130,6 @@ be passed, which will run all tests matching any of the filters. By default, all tests are run in parallel. This can be altered with the --test-threads flag when running tests (set it to 1). - -All tests have their standard output and standard error captured by default. -This can be overridden with the --no-capture flag to a value other than "0". -Logging is not captured by default. - -Test Attributes: - - `#[test]` - Indicates a function is a test to be run. This function - takes no arguments. - `#[bench]` - Indicates a function is a benchmark to be run. This - function takes one argument (test::Bencher). - `#[should_panic]` - This function (also labeled with `#[test]`) will only pass if - the code causes a panic (an assertion failure or panic!) - A message may be provided, which the failure string must - contain: #[should_panic(expected = "foo")]. - `#[ignore]` - When applied to a function which is already attributed as a - test, then the test runner will ignore these tests during - normal test runs. Running with --ignored or --include-ignored will run - these tests. "#; /// Intermediate CLI parser state for [`TestOpts`] From 0ba06645f17f794998653a9a8b96683541f5edbc Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:47:24 -0500 Subject: [PATCH 03/11] fix(lexarg): Re-order help based on related/frequency --- crates/libtest-lexarg/src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index eac571d..13586ed 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -91,34 +91,34 @@ pub const UNSTABLE_OPTIONS: &str = "unstable-options"; pub const OPTIONS_HELP: &str = r#" Options: + --fail-fast Don't start new tests after the first failure --skip FILTER Skip tests whose names contain FILTER (this flag can be used multiple times) --exact Exactly match filters rather than by substring - --test Run tests and not benchmarks - --bench Run benchmarks instead of tests --ignored Run only ignored tests --include-ignored Run ignored and not ignored tests - --fail-fast Don't start new tests after the first failure + --test Run tests and not benchmarks + --bench Run benchmarks instead of tests --no-capture don't capture stdout/stderr of each task, allow printing directly --show-output Show captured stdout of successful tests + --list List all tests and benchmarks --test-threads n_threads Number of threads used for running tests in parallel - --color auto|always|never - Configure coloring of output: - auto = colorize if stdout is a tty and tests are run - on serially (default); - always = always colorize output; - never = never colorize output; --format pretty|terse|json Configure formatting of output: pretty = Print verbose output; terse = Display one character per test; json = Output a json document; - --list List all tests and benchmarks -q, --quiet Display one character per test instead of one line. Alias to --format=terse + --color auto|always|never + Configure coloring of output: + auto = colorize if stdout is a tty and tests are run + on serially (default); + always = always colorize output; + never = never colorize output; -Z unstable-options Enable nightly-only flags: unstable-options = Allow use of experimental features "#; From da02e41f41f134b56a26d662cb528d576f3c1748 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:53:21 -0500 Subject: [PATCH 04/11] fix(lexarg): Modernize option values --- crates/libtest-lexarg/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 13586ed..fb27981 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -104,22 +104,22 @@ Options: printing directly --show-output Show captured stdout of successful tests --list List all tests and benchmarks - --test-threads n_threads + --test-threads NUM Number of threads used for running tests in parallel - --format pretty|terse|json + --format Configure formatting of output: pretty = Print verbose output; terse = Display one character per test; json = Output a json document; -q, --quiet Display one character per test instead of one line. Alias to --format=terse - --color auto|always|never + --color Configure coloring of output: auto = colorize if stdout is a tty and tests are run on serially (default); always = always colorize output; never = never colorize output; - -Z unstable-options Enable nightly-only flags: + -Z FLAG Enable nightly-only flags: unstable-options = Allow use of experimental features "#; From 23bf3583694ba1cd23f68a6a4c0804db741ad5a6 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:54:29 -0500 Subject: [PATCH 05/11] fix(lexarg): Clarify --color=auto --- crates/libtest-lexarg/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index fb27981..69cf1f6 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -115,8 +115,7 @@ Options: Alias to --format=terse --color Configure coloring of output: - auto = colorize if stdout is a tty and tests are run - on serially (default); + auto = detect terminal support (default); always = always colorize output; never = never colorize output; -Z FLAG Enable nightly-only flags: From fe6b7984edb0f79ed201e55772ebb0251ac2f876 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:54:57 -0500 Subject: [PATCH 06/11] fix(lexarg): Clarify lists --- crates/libtest-lexarg/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 69cf1f6..0512c4b 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -108,18 +108,18 @@ Options: Number of threads used for running tests in parallel --format Configure formatting of output: - pretty = Print verbose output; - terse = Display one character per test; - json = Output a json document; + - pretty: Print verbose output + - terse: Display one character per test + - json: Output a json document -q, --quiet Display one character per test instead of one line. Alias to --format=terse --color Configure coloring of output: - auto = detect terminal support (default); - always = always colorize output; - never = never colorize output; + - auto: detect terminal support (default) + - always: always colorize output + - never: never colorize output -Z FLAG Enable nightly-only flags: - unstable-options = Allow use of experimental features + - unstable-options: Allow use of experimental features "#; pub const AFTER_HELP: &str = r#" From eee20feb86154e0aa3ae3f9c85e06efc7f9ddc36 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:57:29 -0500 Subject: [PATCH 07/11] fix(lexarg): Match clap's padding --- crates/libtest-lexarg/src/lib.rs | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 0512c4b..69257cc 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -91,35 +91,35 @@ pub const UNSTABLE_OPTIONS: &str = "unstable-options"; pub const OPTIONS_HELP: &str = r#" Options: - --fail-fast Don't start new tests after the first failure - --skip FILTER Skip tests whose names contain FILTER (this flag can - be used multiple times) - --exact Exactly match filters rather than by substring - --ignored Run only ignored tests - --include-ignored - Run ignored and not ignored tests - --test Run tests and not benchmarks - --bench Run benchmarks instead of tests - --no-capture don't capture stdout/stderr of each task, allow - printing directly - --show-output Show captured stdout of successful tests - --list List all tests and benchmarks - --test-threads NUM - Number of threads used for running tests in parallel - --format - Configure formatting of output: - - pretty: Print verbose output - - terse: Display one character per test - - json: Output a json document - -q, --quiet Display one character per test instead of one line. - Alias to --format=terse - --color - Configure coloring of output: - - auto: detect terminal support (default) - - always: always colorize output - - never: never colorize output - -Z FLAG Enable nightly-only flags: - - unstable-options: Allow use of experimental features + --fail-fast Don't start new tests after the first failure + --skip FILTER Skip tests whose names contain FILTER (this flag can + be used multiple times) + --exact Exactly match filters rather than by substring + --ignored Run only ignored tests + --include-ignored + Run ignored and not ignored tests + --test Run tests and not benchmarks + --bench Run benchmarks instead of tests + --no-capture don't capture stdout/stderr of each task, allow + printing directly + --show-output Show captured stdout of successful tests + --list List all tests and benchmarks + --test-threads NUM + Number of threads used for running tests in parallel + --format + Configure formatting of output: + - pretty: Print verbose output + - terse: Display one character per test + - json: Output a json document + -q, --quiet Display one character per test instead of one line. + Alias to --format=terse + --color + Configure coloring of output: + - auto: detect terminal support (default) + - always: always colorize output + - never: never colorize output + -Z FLAG Enable nightly-only flags: + - unstable-options: Allow use of experimental features "#; pub const AFTER_HELP: &str = r#" From cbe64a586fb98f724efc9279d62aa2c4c851c7db Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:58:48 -0500 Subject: [PATCH 08/11] fix(lexarg): Line break on semantic change --- crates/libtest-lexarg/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 69257cc..f32d6b0 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -92,16 +92,16 @@ pub const UNSTABLE_OPTIONS: &str = "unstable-options"; pub const OPTIONS_HELP: &str = r#" Options: --fail-fast Don't start new tests after the first failure - --skip FILTER Skip tests whose names contain FILTER (this flag can - be used multiple times) + --skip FILTER Skip tests whose names contain FILTER + (this flag can be used multiple times) --exact Exactly match filters rather than by substring --ignored Run only ignored tests --include-ignored Run ignored and not ignored tests --test Run tests and not benchmarks --bench Run benchmarks instead of tests - --no-capture don't capture stdout/stderr of each task, allow - printing directly + --no-capture don't capture stdout/stderr of each task, + allow printing directly --show-output Show captured stdout of successful tests --list List all tests and benchmarks --test-threads NUM From 59677b380319aa8124d10e300601a6e9becd241c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 10:59:15 -0500 Subject: [PATCH 09/11] fix(lexarg): Make --quiets behavior parenthetical --- crates/libtest-lexarg/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index f32d6b0..e5eaaa7 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -111,8 +111,8 @@ Options: - pretty: Print verbose output - terse: Display one character per test - json: Output a json document - -q, --quiet Display one character per test instead of one line. - Alias to --format=terse + -q, --quiet Display one character per test instead of one line + (alias to --format=terse) --color Configure coloring of output: - auto: detect terminal support (default) From 14a6470c2bd097f66b2000388c0d77002c8af43f Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 11:01:33 -0500 Subject: [PATCH 10/11] fix(lexarg): Move test-threads into the option's description --- crates/libtest-lexarg/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index e5eaaa7..1ae1f4d 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -106,6 +106,7 @@ Options: --list List all tests and benchmarks --test-threads NUM Number of threads used for running tests in parallel + (default is >1) --format Configure formatting of output: - pretty: Print verbose output @@ -126,9 +127,6 @@ pub const AFTER_HELP: &str = r#" The FILTER string is tested against the name of all tests, and only those tests whose names contain the filter are run. Multiple filter strings may be passed, which will run all tests matching any of the filters. - -By default, all tests are run in parallel. This can be altered with the ---test-threads flag when running tests (set it to 1). "#; /// Intermediate CLI parser state for [`TestOpts`] From fa5ba7ae0f5fd51432778a2fa0535c76ce7a3bfa Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 18 Sep 2025 11:03:22 -0500 Subject: [PATCH 11/11] fix(lexarg): Move FILTER description into main help --- crates/libtest-lexarg/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/libtest-lexarg/src/lib.rs b/crates/libtest-lexarg/src/lib.rs index 1ae1f4d..499ee2e 100644 --- a/crates/libtest-lexarg/src/lib.rs +++ b/crates/libtest-lexarg/src/lib.rs @@ -90,6 +90,9 @@ impl Default for OutputFormat { pub const UNSTABLE_OPTIONS: &str = "unstable-options"; pub const OPTIONS_HELP: &str = r#" +Arguments: + [FILTER]... Skip tests whose name does not match one of the filters + Options: --fail-fast Don't start new tests after the first failure --skip FILTER Skip tests whose names contain FILTER @@ -123,11 +126,7 @@ Options: - unstable-options: Allow use of experimental features "#; -pub const AFTER_HELP: &str = r#" -The FILTER string is tested against the name of all tests, and only those -tests whose names contain the filter are run. Multiple filter strings may -be passed, which will run all tests matching any of the filters. -"#; +pub const AFTER_HELP: &str = r#""#; /// Intermediate CLI parser state for [`TestOpts`] ///