]> granicus.if.org Git - strace/commitdiff
tests: consistently use $STRACE_EXE instead of local alternatives
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 20 Dec 2017 22:58:42 +0000 (22:58 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 20 Dec 2017 22:58:42 +0000 (22:58 +0000)
* tests/get_regs.test: Replace "${STRACE##* }" with "$STRACE_EXE".
* tests/options-syntax.test: Replace "$strace_exp" with "$STRACE_EXE".
* tests/syntax.sh: Likewise.

tests/get_regs.test
tests/options-syntax.test
tests/syntax.sh

index c673fe9502e59b41f16a9f26c4f85e519757f895..eb69137b9d7820d15e8433df05d404aa557bde30 100755 (executable)
@@ -36,7 +36,7 @@ run_prog ../gettid > /dev/null
 run_strace -qq -esignal=none -eraw=all -etrace=none ../gettid > /dev/null
 
 run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > less' \
-       -- ${STRACE##* } -o "$LOG" $args > /dev/null
+       -- "$STRACE_EXE" -o "$LOG" $args > /dev/null
 
 [ "$(cat less)" -gt 0 ] ||
        fail_ "$STRACE $args failed to catch any ptrace syscalls"
@@ -44,7 +44,7 @@ run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > less' \
 run_strace -qq -esignal=none -eraw=all -etrace=all ../gettid > /dev/null
 
 run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > more' \
-       -- ${STRACE##* } -o "$LOG" $args > /dev/null
+       -- "$STRACE_EXE" -o "$LOG" $args > /dev/null
 
 [ "$(cat more)" -gt 0 ] ||
        fail_ "$STRACE $args failed to catch any ptrace syscalls"
index a0700fe2d13ac8762187e196e147e573f6b67f70..9cfcf5cd37e2234f76b2d679a69d50454bcae7c1 100755 (executable)
@@ -82,12 +82,12 @@ check_h "invalid -s argument: '-42'" -s -42
 check_h "invalid -s argument: '1073741824'" -s 1073741824
 check_h "invalid -I argument: '5'" -I 5
 
-../zeroargc "$strace_exp" /bin/true 2> "$LOG" &&
+../zeroargc "$STRACE_EXE" /bin/true 2> "$LOG" &&
        dump_log_and_fail_with \
                'zeroargc strace failed to handle the error properly'
 cat > "$EXP" << __EOF__
-$strace_exp: must have PROG [ARGS] or -p PID
-Try '$strace_exp -h' for more information.
+$STRACE_EXE: must have PROG [ARGS] or -p PID
+Try '$STRACE_EXE -h' for more information.
 __EOF__
 diff -u -- "$EXP" "$LOG" > /dev/null || {
        cat > "$EXP" <<- '__EOF__'
@@ -109,17 +109,17 @@ if [ -n "${UID-}" ]; then
 
        for c in i r t T y; do
                check_e "-$c has no effect with -c
-$strace_exp: $umsg" -u :nosuchuser: -c -$c true
+$STRACE_EXE: $umsg" -u :nosuchuser: -c -$c true
        done
                check_e "-i has no effect with -c
-$strace_exp: -r has no effect with -c
-$strace_exp: -t has no effect with -c
-$strace_exp: -T has no effect with -c
-$strace_exp: -y has no effect with -c
-$strace_exp: $umsg" -u :nosuchuser: -cirtTy true
+$STRACE_EXE: -r has no effect with -c
+$STRACE_EXE: -t has no effect with -c
+$STRACE_EXE: -T has no effect with -c
+$STRACE_EXE: -y has no effect with -c
+$STRACE_EXE: $umsg" -u :nosuchuser: -cirtTy true
 
        check_e "-tt has no effect with -r
-$strace_exp: $umsg" -u :nosuchuser: -r -tt true
+$STRACE_EXE: $umsg" -u :nosuchuser: -r -tt true
 fi
 
 args='-p 2147483647'
@@ -129,7 +129,7 @@ $STRACE $args 2> "$LOG" &&
 
 for cmd in PTRACE_SEIZE PTRACE_ATTACH; do
        cat > "$EXP" << __EOF__
-$strace_exp: attach: ptrace($cmd, 2147483647): No such process
+$STRACE_EXE: attach: ptrace($cmd, 2147483647): No such process
 __EOF__
        diff -- "$EXP" "$LOG" ||
                continue
index 0a0d2a5722569898989577fe79a4ef449cb4d5d9..b1c8fdc1e0d4e87c5e155ebc2ce1474a89cbc1ed 100644 (file)
@@ -50,13 +50,11 @@ check_exit_status_and_stderr_using_grep()
                        "strace $* failed to print expected diagnostics"
 }
 
-strace_exp="${STRACE##* }"
-
 check_e()
 {
        local pattern="$1"; shift
        cat > "$EXP" << __EOF__
-$strace_exp: $pattern
+$STRACE_EXE: $pattern
 __EOF__
        check_exit_status_and_stderr "$@"
 }
@@ -65,7 +63,7 @@ check_e_using_grep()
 {
        local pattern="$1"; shift
        cat > "$EXP" << __EOF__
-$strace_exp: $pattern
+$STRACE_EXE: $pattern
 __EOF__
        check_exit_status_and_stderr_using_grep "$@"
 }
@@ -74,8 +72,8 @@ check_h()
 {
        local pattern="$1"; shift
        cat > "$EXP" << __EOF__
-$strace_exp: $pattern
-Try '$strace_exp -h' for more information.
+$STRACE_EXE: $pattern
+Try '$STRACE_EXE -h' for more information.
 __EOF__
        check_exit_status_and_stderr "$@"
 }