Skip to content

Commit 1ca9594

Browse files
committed
add --failed flag
1 parent 07cd0f0 commit 1ca9594

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/bootstrap/flags.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ pub enum Subcommand {
333333
/// do not run doc tests
334334
no_doc: bool,
335335
#[arg(long)]
336+
/// rerun failed tests
337+
failed: bool,
338+
#[arg(long)]
336339
/// only run doc tests
337340
doc: bool,
338341
#[arg(long)]
@@ -458,6 +461,13 @@ impl Subcommand {
458461
}
459462
}
460463

464+
pub fn failed(&self) -> bool {
465+
match *self {
466+
Subcommand::Test { failed, .. } => !failed,
467+
_ => false,
468+
}
469+
}
470+
461471
pub fn doc_tests(&self) -> DocTests {
462472
match *self {
463473
Subcommand::Test { doc, no_doc, .. } => {

src/etc/completions/x.py.fish

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ complete -c x.py -n "__fish_seen_subcommand_from test" -l reproducible-artifact
262262
complete -c x.py -n "__fish_seen_subcommand_from test" -l set -d 'override options in config.toml' -r -f
263263
complete -c x.py -n "__fish_seen_subcommand_from test" -l no-fail-fast -d 'run all tests regardless of failure'
264264
complete -c x.py -n "__fish_seen_subcommand_from test" -l no-doc -d 'do not run doc tests'
265+
complete -c x.py -n "__fish_seen_subcommand_from test" -l failed -d 'rerun failed tests'
265266
complete -c x.py -n "__fish_seen_subcommand_from test" -l doc -d 'only run doc tests'
266267
complete -c x.py -n "__fish_seen_subcommand_from test" -l bless -d 'whether to automatically update stderr/stdout files'
267268
complete -c x.py -n "__fish_seen_subcommand_from test" -l force-rerun -d 'rerun tests even if the inputs are unchanged'

src/etc/completions/x.py.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
335335
[CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
336336
[CompletionResult]::new('--no-fail-fast', 'no-fail-fast', [CompletionResultType]::ParameterName, 'run all tests regardless of failure')
337337
[CompletionResult]::new('--no-doc', 'no-doc', [CompletionResultType]::ParameterName, 'do not run doc tests')
338+
[CompletionResult]::new('--failed', 'failed', [CompletionResultType]::ParameterName, 'rerun failed tests')
338339
[CompletionResult]::new('--doc', 'doc', [CompletionResultType]::ParameterName, 'only run doc tests')
339340
[CompletionResult]::new('--bless', 'bless', [CompletionResultType]::ParameterName, 'whether to automatically update stderr/stdout files')
340341
[CompletionResult]::new('--force-rerun', 'force-rerun', [CompletionResultType]::ParameterName, 'rerun tests even if the inputs are unchanged')

src/etc/completions/x.py.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ _x.py() {
16251625
return 0
16261626
;;
16271627
x.py__test)
1628-
opts="-v -i -j -h --no-fail-fast --skip --test-args --rustc-args --no-doc --doc --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
1628+
opts="-v -i -j -h --no-fail-fast --skip --test-args --rustc-args --no-doc --failed --doc --bless --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
16291629
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
16301630
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
16311631
return 0

0 commit comments

Comments
 (0)