]> granicus.if.org Git - strace/blobdiff - tests/strace-S.test
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / strace-S.test
index 7b188aa67bd8b35612a0f0ae2eec4153c6960480..64e4a41e5aa1d20ce283c1ba5dd62c9848ffde71 100755 (executable)
@@ -4,7 +4,7 @@
 
 . "${srcdir=.}/init.sh"
 
-run_prog_skip_if_failed date > /dev/null
+run_prog ../readv > /dev/null
 
 test_c()
 {
@@ -13,16 +13,18 @@ test_c()
        sortopts="$1"; shift
        sedexpr="$1"; shift
 
-       run_strace -c -S "$sortby" date > /dev/null
-       sed -ne "$sedexpr" < "$LOG" > "$OUT"
+       run_strace -c -w -S "$sortby" ../readv > /dev/null
+       sed -r -n -e "$sedexpr" < "$LOG" > "$OUT"
 
        [ -s "$OUT" ] ||
                fail_ "$STRACE $args output mismatch"
-       LC_ALL=C sort -c $sortopts "$OUT" ||
+       LC_ALL=C sort -c $sortopts "$OUT" || {
+               echo 'Actual output:'
+               cat < "$LOG"
                fail_ "$STRACE $args output not sorted properly"
+       }
 }
 
-c='[[:space:]]\+\([^[:space:]]\+\)'
-test_c calls '-n -r' '/^[[:space:]]\+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p'
-
-rm -f "$OUT"
+c='[[:space:]]+([^[:space:]]+)'
+test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p'
+test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p'