tests: add strace-S.test
* tests/strace-S.test: New test. * tests/Makefile.am (MISC_TESTS): Add it.
This commit is contained in:
parent
58ab8b49e0
commit
6781111857
@ -605,6 +605,7 @@ MISC_TESTS = \
|
||||
qual_syscall.test \
|
||||
redirect.test \
|
||||
restart_syscall.test \
|
||||
strace-S.test \
|
||||
strace-T.test \
|
||||
strace-V.test \
|
||||
strace-f.test \
|
||||
|
52
tests/strace-S.test
Executable file
52
tests/strace-S.test
Executable file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check -S option.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
|
||||
run_prog_skip_if_failed date > /dev/null
|
||||
run_strace -c -S calls $args
|
||||
OUT="$LOG.out"
|
||||
EXP="$LOG.exp"
|
||||
|
||||
rm -f "$OUT" "$EXP"
|
||||
|
||||
check_prog awk
|
||||
check_prog sort
|
||||
awk '{print $4}' "$LOG" > "$OUT"
|
||||
|
||||
exec 4<&0 0<"$OUT"
|
||||
while
|
||||
read item
|
||||
do
|
||||
if [ "$item" = "---------" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
while
|
||||
read item
|
||||
do
|
||||
if [ "$item" = "---------" ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "$item" >> "$EXP"
|
||||
done
|
||||
|
||||
exec 0<&4
|
||||
|
||||
if [ -s $EXP ]
|
||||
then
|
||||
sort -c -g -r "$EXP"
|
||||
if [ "$?" = "1" ]
|
||||
then
|
||||
fail_ "not sorted"
|
||||
fi
|
||||
else
|
||||
fail_ "no file"
|
||||
fi
|
||||
|
||||
rm -f "$OUT" "$EXP"
|
Loading…
Reference in New Issue
Block a user