Debian Codegraph @

tests/cmdline

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 set -e
4
5 : "${SOCKET_ACTIVATE:=socket-activate}"
6
7 stdout='tests/stdout'
8 stderr='tests/stderr'
9
10 res=0
11 "$SOCKET_ACTIVATE" --help >"$stdout" 2>"$stderr" || res="$?"
12 if [scip-shell system . . `[`. -s "$stderr" ]; then
13 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --help exited with code $res and output some errors:" >&2
14 catscip-shell system . . cat. -- "$stderr" >&2
15 exit 1
16 fi
17 if [scip-shell system . . `[`. "$res" != 0 ]; then
18 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --help exited with code $res" >&2
19 exit 1
20 fi
21 if ! fgrepscip-shell system . . fgrep. -qie usage -- "$stdout"; then
22 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --help did not say anything about usage:" >&2
23 catscip-shell system . . cat. -- "$stdout" >&2
24 exit 1
25 fi
26
27 res=0
28 "$SOCKET_ACTIVATE" --version >"$stdout" 2>"$stderr" || res="$?"
29 if [scip-shell system . . `[`. -s "$stderr" ]; then
30 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --version exited with code $res and output some errors:" >&2
31 catscip-shell system . . cat. -- "$stderr" >&2
32 exit 1
33 fi
34 if [scip-shell system . . `[`. "$res" != 0 ]; then
35 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --version exited with code $res" >&2
36 exit 1
37 fi
38 if ! egrepscip-shell system . . egrep. -qe 'socket-activate[[:space:]]+[0-9]' -- "$stdout"; then
39 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --version did not introduce itself:" >&2
40 catscip-shell system . . cat. -- "$stdout" >&2
41 exit 1
42 fi
43
44 if [scip-shell system . . `[`. -n "$(command -v feature-check)" ]; then
45 feature-check -- "$SOCKET_ACTIVATE" socket-activate
46 else
47 echoscip-shell system . . echo. 'No feature-check, checking the old-fashioned way'
48
49 res=0
50 "$SOCKET_ACTIVATE" --features >"$stdout" 2>"$stderr" || res="$?"
51 if [scip-shell system . . `[`. -s "$stderr" ]; then
52 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --features exited with code $res and output some errors:" >&2
53 catscip-shell system . . cat. -- "$stderr" >&2
54 exit 1
55 fi
56 if [scip-shell system . . `[`. "$res" != 0 ]; then
57 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --features exited with code $res" >&2
58 exit 1
59 fi
60 if ! egrepscip-shell system . . egrep. -qe 'Features:.*[[:space:]]socket-activate=[0-9]' -- "$stdout"; then
61 echoscip-shell system . . echo. "$SOCKET_ACTIVATE --features did not introduce itself:" >&2
62 catscip-shell system . . cat. -- "$stdout" >&2
63 exit 1
64 fi
65 fi