tests: support alternative names of select syscall

* tests/select.awk: Recognize "_newselect" as another name of "select".
* tests/select.test: Try alternative names of select syscall.
This commit is contained in:
Дмитрий Левин 2015-02-16 01:23:00 +00:00
parent f97a4774d2
commit 4a00fc4867
2 changed files with 15 additions and 4 deletions

View File

@ -1,7 +1,8 @@
BEGIN {
r[1] = "^select\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL\\) += 1 \\(\\)$"
r[2] = "^select\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL\\) += -1 "
r[3] = "^select\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100\\}\\) += 0 \\(Timeout\\)$"
select = "^(select|_newselect)"
r[1] = select "\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL\\) += 1 \\(\\)$"
r[2] = select "\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL\\) += -1 "
r[3] = select "\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100\\}\\) += 0 \\(Timeout\\)$"
r[4] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
lines = 4
fail = 0

View File

@ -9,7 +9,17 @@ check_prog awk
./select ||
framework_skip_ 'select syscall does not behave as expected'
args="-eselect ./select"
syscall=
for n in select _newselect; do
if $STRACE -e$n -h > /dev/null; then
syscall=$n
break
fi
done
[ -n "$syscall" ] ||
fail_ "$STRACE does not support select syscall?"
args="-e$syscall ./select"
$STRACE -o "$LOG" $args || {
cat "$LOG"
fail_ "$STRACE $args failed"