Debian Codegraph @

govc/test/vendor/github.com/sstephenson/bats/libexec/bats-exec-suite

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2 set -e
3
4 count_only_flag=""
5 if [scip-shell system . . `[`. "$1" = "-c" ]; then
6 count_only_flag=1
7 shift
8 fi
9
10 extended_syntax_flag=""
11 if [scip-shell system . . `[`. "$1" = "-x" ]; then
12 extended_syntax_flag="-x"
13 shift
14 fi
15
16 trap "kill 0; exit 1" int
17
18 count=0
19 for filename in "$@"; do
20 let count+="$(bats-exec-test -c "$filename")"
21 done
22
23 if [scip-shell system . . `[`. -n "$count_only_flag" ]; then
24 echoscip-shell system . . echo. "$count"
25 exit
26 fi
27
28 echoscip-shell system . . echo. "1..$count"
29 status=0
30 offset=0
31 for filename in "$@"; do
32 index=0
33 {
34 IFS= read -r # 1..n
35 while IFS= read -r line; do
36 case "$line" in
37 "begin "* )
38 let index+=1
39 echoscip-shell system . . echo. "${line/ $index / $(($offset + $index)) }"
40 ;;
41 "ok "* | "not ok "* )
42 [scip-shell system . . `[`. -n "$extended_syntax_flag" ] || let index+=1
43 echoscip-shell system . . echo. "${line/ $index / $(($offset + $index)) }"
44 [scip-shell system . . `[`. "${line:0:6}" != "not ok" ] || status=1
45 ;;
46 * )
47 echoscip-shell system . . echo. "$line"
48 ;;
49 esac
50 done
51 } < <( bats-exec-test $extended_syntax_flag "$filename" )
52 offset=$(($offset + $index))
53 done
54
55 exit "$status"