]> granicus.if.org Git - strace/commitdiff
tests: robustify options-syntax.test against inquisitive musl
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 1 Nov 2017 01:43:25 +0000 (01:43 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 1 Nov 2017 01:43:25 +0000 (01:43 +0000)
Workaround musl >= 1.1.17 ability to use AT_EXECFN during
program_invocation_name initialization.

* tests/options-syntax.test: Check for two valid variants
of "zeroargc strace" expected output.

tests/options-syntax.test

index b4d9be7077e946f02a2496203e5beefcf8d34b3f..2e459c9641a5a9a5c10c7ea837c0055e5845fe82 100755 (executable)
@@ -80,16 +80,21 @@ check_h "invalid -s argument: '-42'" -s -42
 check_h "invalid -s argument: '1073741824'" -s 1073741824
 check_h "invalid -I argument: '5'" -I 5
 
-cat > "$EXP" << '__EOF__'
-strace: must have PROG [ARGS] or -p PID
-Try 'strace -h' for more information.
-__EOF__
 ../zeroargc "$strace_exp" /bin/true 2> "$LOG" &&
        dump_log_and_fail_with \
                'zeroargc strace failed to handle the error properly'
-match_diff "$LOG" "$EXP" ||
-       dump_log_and_fail_with \
-               'zeroargc strace failed to print expected diagnostics'
+cat > "$EXP" << __EOF__
+$strace_exp: must have PROG [ARGS] or -p PID
+Try '$strace_exp -h' for more information.
+__EOF__
+diff -u -- "$EXP" "$LOG" > /dev/null || {
+       cat > "$EXP" <<- '__EOF__'
+       strace: must have PROG [ARGS] or -p PID
+       Try 'strace -h' for more information.
+       __EOF__
+       match_diff "$LOG" "$EXP" \
+               "zeroargc $STRACE $args output mismatch"
+}
 
 if [ -n "${UID-}" ]; then
        if [ "${UID-}" = 0 ]; then