2012-04-22 21:08:29 +04:00
|
|
|
# bash completion for ctest(1) -*- shell-script -*-
|
|
|
|
|
|
|
|
_ctest()
|
|
|
|
{
|
|
|
|
local cur prev words cword
|
2015-04-22 15:15:02 +03:00
|
|
|
if type -t _init_completion >/dev/null; then
|
|
|
|
_init_completion -n = || return
|
|
|
|
else
|
|
|
|
# manual initialization for older bash completion versions
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
fi
|
2012-04-22 21:08:29 +04:00
|
|
|
|
|
|
|
case "$prev" in
|
|
|
|
-C|--build-config)
|
|
|
|
COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
|
|
|
|
MinSizeRel' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-j|--parallel)
|
|
|
|
COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-O|--output-log|-A|--add-notes|--extra-submit)
|
|
|
|
_filedir
|
|
|
|
return
|
|
|
|
;;
|
2014-09-03 22:26:17 +04:00
|
|
|
-L|--label-regex|-LE|--label-exclude)
|
|
|
|
COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null |
|
|
|
|
grep "^ " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
--track|-I|--tests-information|--max-width|--timeout|--stop-time)
|
2012-04-22 21:08:29 +04:00
|
|
|
# argument required but no completions available
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-R|--tests-regex|-E|--exclude-regex)
|
|
|
|
COMPREPLY=( $( compgen -W '$( ctest -N 2>/dev/null |
|
|
|
|
grep "^ Test" 2>/dev/null | cut -d: -f 2 )' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-D|--dashboard)
|
|
|
|
if [[ $cur == @(Experimental|Nightly|Continuous)* ]]; then
|
|
|
|
local model action
|
|
|
|
action=${cur#@(Experimental|Nightly|Continuous)}
|
|
|
|
model=${cur%"$action"}
|
|
|
|
COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
|
|
|
|
Coverage Submit MemCheck' -P "$model" -- "$action" ) )
|
|
|
|
else
|
|
|
|
COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' \
|
|
|
|
-- "$cur" ) )
|
|
|
|
compopt -o nospace
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-M|--test-model)
|
|
|
|
COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' -- \
|
|
|
|
"$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-T|--test-action)
|
|
|
|
COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
|
|
|
|
Coverage Submit MemCheck' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-S|--script|-SP|--script-new-process)
|
2013-07-30 02:32:17 +04:00
|
|
|
_filedir '@(cmake|ctest)'
|
2012-04-22 21:08:29 +04:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
--interactive-debug-mode)
|
|
|
|
COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
--help-command)
|
|
|
|
COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null|
|
2013-09-23 21:31:03 +04:00
|
|
|
grep -v "^ctest version " )' -- "$cur" ) )
|
2012-04-22 21:08:29 +04:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
|
|
COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
|
|
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
|
|
[[ $COMPREPLY ]] && return
|
|
|
|
fi
|
|
|
|
|
|
|
|
_filedir
|
|
|
|
} &&
|
|
|
|
complete -F _ctest ctest
|
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|