]> granicus.if.org Git - strace/commitdiff
tests: verify that all patterns match
authorAndreas Schwab <schwab@suse.de>
Wed, 11 Mar 2015 16:49:06 +0000 (17:49 +0100)
committerAndreas Schwab <schwab@suse.de>
Mon, 16 Mar 2015 15:22:24 +0000 (16:22 +0100)
* tests/ipc_msg.test: Count matches to verify that all patterns match.
* tests/ipc_sem.test: Likewise.
* tests/ipc_shm.test: Likewise.
* tests/stat32-v.test: Likewise.
* tests/stat64-v.test: Likewise.

tests/ipc_msg.test
tests/ipc_sem.test
tests/ipc_shm.test
tests/stat32-v.test
tests/stat64-v.test

index b1ebe6d6dbe9c1cc621078a79caf3445c9dc7219..e0d27edcbc5418b7820ed19cfe066c4843df0e3b 100755 (executable)
@@ -16,9 +16,11 @@ OUT="$LOG.out"
        fi
 }
 
-args="-eipc ./ipc_msg $f"
+args="-eipc ./ipc_msg"
 $STRACE -o "$LOG" $args > "$OUT" &&
-LC_ALL=C grep -E -x -f "$OUT" "$LOG" > /dev/null || {
+exp_lines=$(wc -l < "$OUT") &&
+matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") &&
+test $exp_lines -eq $matched_lines || {
        cat "$OUT" "$LOG"
        fail_ "$STRACE $args output mismatch"
 }
index b8fa545f5f94abd3a9703300f6872521a4411141..ef957c3e0eb5cbbb01f75d59e61e8928efae69eb 100755 (executable)
@@ -18,7 +18,9 @@ OUT="$LOG.out"
 
 args='-eipc ./ipc_sem'
 $STRACE -o "$LOG" $args > "$OUT" &&
-LC_ALL=C grep -E -x -f "$OUT" "$LOG" > /dev/null || {
+exp_lines=$(wc -l < "$OUT") &&
+matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") &&
+test $exp_lines -eq $matched_lines || {
        cat "$OUT" "$LOG"
        fail_ "$STRACE $args output mismatch"
 }
index b09dc2b7ac724c1a2a5069a4f5c3684600397465..de8b47c1870b35c5e502f380600735f693c84947 100755 (executable)
@@ -16,9 +16,11 @@ OUT="$LOG.out"
        fi
 }
 
-args="-eipc ./ipc_shm $f"
+args="-eipc ./ipc_shm"
 $STRACE -o "$LOG" $args > "$OUT" &&
-LC_ALL=C grep -E -x -f "$OUT" "$LOG" > /dev/null || {
+exp_lines=$(wc -l < "$OUT") &&
+matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") &&
+test $exp_lines -eq $matched_lines || {
        cat "$OUT" "$LOG"
        fail_ "$STRACE $args output mismatch"
 }
index 7f8cb4a4b8da0c540fab91c1d6960dfb3c787f33..67eb5edcad7e4605894ae215b03b57f4267acf20 100755 (executable)
@@ -33,7 +33,9 @@ touch -t 0102030405 $sample
 for f in $sample . /dev/null; do
        args="-v -efile ./stat32 $f"
        $STRACE -o "$LOG" $args > "$OUT" &&
-       LC_ALL=C grep -E -x -f "$OUT" "$LOG" > /dev/null || {
+       exp_lines=$(wc -l < "$OUT") &&
+       matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") &&
+       test $exp_lines -eq $matched_lines || {
                cat "$OUT" "$LOG"
                fail_ "$STRACE $args output mismatch"
        }
index f03254a92a33885039a7024091e6a8247f98d8ad..785403dc1b468c24b6e831ef3fa18bd52b193352 100755 (executable)
@@ -27,7 +27,9 @@ touch -d '1970-01-01 -42 seconds' $sample
 for f in $sample . /dev/null; do
        args="-v -efile ./stat $f"
        $STRACE -o "$LOG" $args > "$OUT" &&
-       LC_ALL=C grep -E -x -f "$OUT" "$LOG" > /dev/null || {
+       exp_lines=$(wc -l < "$OUT") &&
+       matched_lines=$(LC_ALL=C grep -c -E -x -f "$OUT" "$LOG") &&
+       test $exp_lines -eq $matched_lines || {
                cat "$OUT" "$LOG"
                fail_ "$STRACE $args output mismatch"
        }