Merge pull request #723 from syohex/syohex/perf-test

Update 'perf test' completion
This commit is contained in:
Shohei YOSHIDA 2020-05-11 23:41:23 +09:00 committed by GitHub
commit 1e42bda442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,12 @@ _perf_c2c_coalesce() {
_values -s ',' 'columns' $columns _values -s ',' 'columns' $columns
} }
_perf_test_list() {
# TODO show test detail
local -a test_list=(${(@f)$(perf test list 2>&1 | sed -n -e 's/^ *\([^ ]*\): \(.*\)$/\1/p')})
_values -s ',' 'test' $test_list
}
_perf() { _perf() {
local context curcontext="$curcontext" state line local context curcontext="$curcontext" state line
typeset -A opt_args typeset -A opt_args
@ -302,6 +308,9 @@ _perf() {
(test) (test)
_arguments \ _arguments \
'(-v --verbose)'{-v,--verbose}'[be more verbose]' \ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
'(-s --skip)'{-s,--skip=}'[Tests to skip]:tests:_perf_test_list' \
'(-F --dont-fork)'{-F,--dont-fork}'[do not fork child for each test]' \
'1:command:((list))' \
&& ret=0 && ret=0
;; ;;
(timechart) (timechart)