| .. | .. |
|---|
| 1 | 1 | #!/bin/sh |
|---|
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
|---|
| 3 | 3 | # description: event trigger - test synthetic_events syntax parser errors |
|---|
| 4 | | -# requires: synthetic_events error_log "char name[]' >> synthetic_events":README |
|---|
| 4 | +# requires: synthetic_events error_log |
|---|
| 5 | 5 | |
|---|
| 6 | 6 | check_error() { # command-with-error-pos-by-^ |
|---|
| 7 | 7 | ftrace_errlog_check 'synthetic_events' "$1" 'synthetic_events' |
|---|
| 8 | 8 | } |
|---|
| 9 | 9 | |
|---|
| 10 | | -check_dyn_error() { # command-with-error-pos-by-^ |
|---|
| 11 | | - ftrace_errlog_check 'synthetic_events' "$1" 'dynamic_events' |
|---|
| 12 | | -} |
|---|
| 13 | | - |
|---|
| 14 | 10 | check_error 'myevent ^chr arg' # INVALID_TYPE |
|---|
| 15 | | -check_error 'myevent ^unsigned arg' # INCOMPLETE_TYPE |
|---|
| 16 | | - |
|---|
| 17 | | -check_error 'myevent char ^str]; int v' # BAD_NAME |
|---|
| 18 | | -check_error '^mye-vent char str[]' # BAD_NAME |
|---|
| 19 | | -check_error 'myevent char ^st-r[]' # BAD_NAME |
|---|
| 20 | | - |
|---|
| 21 | | -check_error 'myevent char str;^[]' # INVALID_FIELD |
|---|
| 22 | | -check_error 'myevent char str; ^int' # INVALID_FIELD |
|---|
| 23 | | - |
|---|
| 24 | | -check_error 'myevent char ^str[; int v' # INVALID_ARRAY_SPEC |
|---|
| 25 | | -check_error 'myevent char ^str[kdjdk]' # INVALID_ARRAY_SPEC |
|---|
| 26 | | -check_error 'myevent char ^str[257]' # INVALID_ARRAY_SPEC |
|---|
| 27 | | - |
|---|
| 28 | | -check_error '^mye;vent char str[]' # INVALID_CMD |
|---|
| 29 | | -check_error '^myevent ; char str[]' # INVALID_CMD |
|---|
| 30 | | -check_error '^myevent; char str[]' # INVALID_CMD |
|---|
| 31 | | -check_error '^myevent ;char str[]' # INVALID_CMD |
|---|
| 32 | | -check_error '^; char str[]' # INVALID_CMD |
|---|
| 33 | | -check_error '^;myevent char str[]' # INVALID_CMD |
|---|
| 34 | | -check_error '^myevent' # INVALID_CMD |
|---|
| 35 | | - |
|---|
| 36 | | -check_dyn_error '^s:junk/myevent char str[' # INVALID_DYN_CMD |
|---|
| 11 | +check_error 'myevent ^char str[];; int v' # INVALID_TYPE |
|---|
| 12 | +check_error 'myevent char ^str]; int v' # INVALID_NAME |
|---|
| 13 | +check_error 'myevent char ^str;[]' # INVALID_NAME |
|---|
| 14 | +check_error 'myevent ^char str[; int v' # INVALID_TYPE |
|---|
| 15 | +check_error '^mye;vent char str[]' # BAD_NAME |
|---|
| 16 | +check_error 'myevent char str[]; ^int' # INVALID_FIELD |
|---|
| 17 | +check_error '^myevent' # INCOMPLETE_CMD |
|---|
| 37 | 18 | |
|---|
| 38 | 19 | exit 0 |
|---|