mtest: add -k as alias to --maxfail

An equivalent option is available on ninja as -k, so let's alias that.
This commit is contained in:
Daniel Foster
2026-04-04 13:45:16 +10:00
committed by Paolo Bonzini
parent f8dbedd70c
commit 1a69438552
3 changed files with 4 additions and 2 deletions

View File

@@ -561,6 +561,7 @@ _meson-test() {
shortopts=(
h
j
k
q
v
t
@@ -595,7 +596,7 @@ _meson-test() {
local cur prev
if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then
case $prev in
--maxfail | --repeat)
-k | --maxfail | --repeat)
# number, can't be completed
return
;;

View File

@@ -182,6 +182,7 @@ local -a meson_commands=(
# TODO: complete test suites
local -a specs=(
'(--maxfail -k)'{'--maxfail','-k'}'=[number of failing tests before aborting]:number of failing tests: '
'--repeat[number of times to run the tests]:number of times to repeat: '
'--no-rebuild[do not rebuild before running tests]'
'--gdb[run tests under gdb]'

View File

@@ -127,7 +127,7 @@ def test_slice(arg: str) -> T.Tuple[int, int]:
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
def add_arguments(parser: argparse.ArgumentParser) -> None:
parser.add_argument('--maxfail', default=0, type=int,
parser.add_argument('-k', '--maxfail', default=0, type=int,
help='Number of failing tests before aborting the '
'test run. (default: 0, to disable aborting on failure)')
parser.add_argument('--repeat', default=1, dest='repeat', type=int,