-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_boosttest
137 lines (131 loc) · 7.62 KB
/
_boosttest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#compdef -P -value-,BOOST_TEST_*,-default-
# zsh completion script for boost unit tests
# Copyright CERN for the benefit of the LHCb collaboration 2019
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
_booleans() {
local -a booleans; booleans=('True' 'False')
_describe -t booleans 'boolean' booleans
}
_sinks() {
local -a sinks; sinks=("stderr" "stdout" "<filename>")
_describe -t sinks 'sinks' sinks
}
_hcx() {
local -a formats; formats=("HRF" "CLF" "XML")
_describe -t hcxformats 'formats' formats
}
_boost_test_catch_system_errors() { _booleans }
_boost_test_color_output() { _booleans }
_boost_test_auto_start_dbg() { _booleans }
_boost_test_build_info() { _booleans }
_boost_test_detect_fp_exceptions() { _booleans }
_boost_test_list_labels() { _booleans }
_boost_test_result_code() { _booleans }
_boost_test_save_pattern() { _booleans }
_boost_test_show_progress() { _booleans }
_boost_test_use_alt_stack() { _booleans }
_boost_test_version() { _booleans }
_boost_test_wait_for_debugger() { _booleans }
_boost_test_usage() { _booleans }
_boost_test_break_exec_path() { _message "execution path to break at" }
_boost_test_detect_memory_leaks() { _message "alloc order number (optional)" }
_boost_test_log_level() {
local -a loglevels
loglevels=("all" "success" "test_suite" "unit_scope" "message" "warning" "error" "cpp_exception" "system_error" "fatal_error" "nothing")
_describe -t loglevels 'log levels' loglevels
}
_boost_test_log_sink() { _sinks }
_boost_test_report_sink() { _sinks }
_boost_test_report_format() { _hcx }
_boost_test_output_format() { _hcx }
_boost_test_log_format() {
local -a formats; formats=("HRF" "CLF" "XML" "JUNIT")
_describe -t hcxjformats 'formats' formats
}
_boost_test_list_content () {
local -a formats; formats=("HRF" "DOT")
_describe -t hdformats 'format (optional)' formats
}
_boost_test_logger() {
(( commas=${#${words[$CURRENT]//[^,:]}} ))
(( remainder=$commas % 3 ))
if (( $commas >= 3 && $remainder == 0 )); then
_message "may stop now"
compset -P '*:'
elif (( $commas >= 1 && $remainder != 0 )); then
compset -P '*,'
fi
case $remainder in
0)
local -a formats; formats=("HRF" "CLF" "XML" "JUNIT")
_describe -t hcxjformats 'formats' formats -q -S ','
;;
1)
local -a loglevels
loglevels=("all" "success" "test_suite" "unit_scope" "message" "warning" "error" "cpp_exception" "system_error" "fatal_error" "nothing")
_describe -t loglevels 'log levels' loglevels -q -S ','
;;
2)
local -a sinks; sinks=("stderr" "stdout" "<filename>")
_describe -t sinks 'sinks' sinks -q -S ':'
;;
esac
}
_boost_test_random() {
_message "random seed (optional)"
}
_boost_test_report_level() {
local -a levels; levels=("confirm" "short" "detailed" "no")
_describe -t levels 'levels' levels
}
_boost_test_report_memory_leaks_to() {
_path_files
}
_boost_test_run_test() {
_message "test unit filter"
}
_boost_test_help() {
local -a help_paramters;help_parameters=("catch_system_errors" "color_output" "auto_start_dbg" "build_info" "detect_fp_exceptions" "list_labels" "result_code" "save_pattern" "show_progress" "use_alt_stack" "version" "wait_for_debugger" "usage" "break_exec_path" "detect_memory_leaks" "log_level" "log_sink" "report_sink" "report_format" "output_format" "log_format" "list_content " "logger" "random" "report_level" "report_memory_leaks_to" "run_test" "help")
_describe -t helpparams 'help parameters' help_parameters
}
if [[ "$service" = -value-* ]]; then
var=${${${service:l}#-value-,}/,*}
local retval
_call_function retval _${var}
return
fi
_arguments \
"(--no_catch_system_errors --catch_system_errors -s)"{--no_catch_system_errors=-,--catch_system_errors=-,-s}"[Allows to switch between catching and ignoring system errors (signals).]::boolean value:_boost_test_catch_system_errors" \
"(--color_output --no_color_output -x)"{--color_output=-,--no_color_output=-,-x}"[Enables color output of the framework log and report messages.]::boolean value:_boost_test_color_output" \
"(--auto_start_dbg -d)"{--auto_start_dbg=-,-d}"[Automatically attaches debugger in case of system level failure (signal).]::boolean value:_boost_test_auto_start_dbg" \
"(--build_info -i)"{--build_info=-,-i}"[Displays library build information.]::boolean value:_boost_test_build_info" \
"(--detect_fp_exceptions --no_detect_fp_exceptions)"{--detect_fp_exceptions=-,--no_detect_fp_exceptions=-}"[Enables/disables floating point exceptions traps.]::boolean value:_boost_test_detect_fp_exceptions" \
"--list_labels=-[Lists all available labels.]:boolean value:_boost_test_list_labels" \
"(--result_code --no_result_code -c)"{--result_code=-,--no_result_code=-,-c}"[Disables test modules's result code generation.]::boolean value:_boost_test_result_code" \
"--save_pattern=-[Allows to switch between saving or matching test pattern file.]::boolean value:_boost_test_save_pattern" \
"(--show_progress -p)"{--show_progress=-,-p}"[Turns on progress display.]::boolean value:_boost_test_show_progress" \
"(--no_use_alt_stack --use_alt_stack)"{--no_use_alt_stack=-,--use_alt_stack=-}"[Turns on/off usage of an alternative stack for signal handling.]::boolean value:_boost_test_use_alt_stack" \
"--version-[Prints Boost.Test version and exits.]::boolean value:_boost_test_version" \
"(--wait_for_debugger -w)"{--wait_for_debugger=-,-w}"[Forces test module to wait for button to be pressed before starting test run.]::boolean value:_boost_test_wait_for_debugger" \
"-\\?[Short message explaining usage of Boost.Test parameters.]::boolean value:_boost_test_usage" \
"--break_exec_path=-[For the exception safety testing allows to break at specific execution path.]:value:_boost_test_break_exec_path" \
"--detect_memory_leaks=-[Turns on/off memory leaks detection (optionally breaking on specified alloc order number).]::alloc order number:_boost_test_detect_memory_leaks" \
"(--log_level -l)"{--log_level=-,-l}"[Specifies the logging level of the test execution.]:log level:_boost_test_log_level" \
"(--log_sink -k)"{--log_sink=-,-k}"[Specifies log sink]:sink:_boost_test_log_sink" \
"(-e --report_sink)"{-e,--report_sink=}"[Specifies report sink]:sink:_boost_test_report_sink" \
"(--output_format -o)"{--output_format=-,-o}"[Specifies output format (both log and report).]:format:_boost_test_output_format" \
"(--report_format -m)"{--report_format=-,-m}"[Specifies the test report format.]:format:_boost_test_report_format" \
"(--log_format -f)"{--log_format=-,-f}"[Specifies log format.]:format:_boost_test_log_format" \
"--help=-[Help for framework parameters.]::parameter name:_boost_test_help" \
"--list_content=-[Lists the content of test tree - names of all test suites and test cases.]::format:_boost_test_list_content" \
"--logger=-[Specifies log level and sink for one or several log format]:format,level,sink:_boost_test_logger" \
"--random=-[Allows to switch between sequential and random order of test units execution. Optionally allows to specify concrete seed for random number generator.]::seed:_boost_test_random" \
"(--report_level -r)"{--report_level=-,-r}"[Specifies test report level.]:report level:_boost_test_report_level" \
"--report_memory_leaks_to=-[File where to report memory leaks to.]:file name:_boost_test_report_memory_leaks_to" \
"(--run_test -t)"{--run_test=-,-t}"[Filters which tests to execute.]:test unit filter:_boost_test_run_test"