diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2015-03-18 19:14:02 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2015-03-18 22:41:17 +0000 |
commit | 226bf1c21b8f04f7fa1655979fe00adee1e68b5e (patch) | |
tree | 5253a2ed5659fd2a2d010224471f74b8a5e56ee7 /tests/select.awk | |
parent | 6add1b09d656887e282947f1ee129ee9003530c6 (diff) | |
download | android_external_strace-226bf1c21b8f04f7fa1655979fe00adee1e68b5e.tar.gz android_external_strace-226bf1c21b8f04f7fa1655979fe00adee1e68b5e.tar.bz2 android_external_strace-226bf1c21b8f04f7fa1655979fe00adee1e68b5e.zip |
tests: factor out common awk code
Factor out awk code used in several tests to match.awk.
* tests/match.awk: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/caps.awk: Use it.
* tests/getdents.awk: Likewise.
* tests/getrandom.awk: Likewise.
* tests/select.awk: Likewise.
* tests/sigaction.awk: Likewise.
* tests/init.sh (match_awk): Use gawk not awk. Define AWKPATH.
* tests/getdents.test: Likewise.
Diffstat (limited to 'tests/select.awk')
-rw-r--r-- | tests/select.awk | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/tests/select.awk b/tests/select.awk index 688cefe4..996d0285 100644 --- a/tests/select.awk +++ b/tests/select.awk @@ -2,25 +2,10 @@ BEGIN { r[1] = "^p?select6?\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL(, 0)?\\) += 1 \\(\\)$" r[2] = "^p?select6?\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL(, 0)?\\) += -1 " r[3] = "^p?select6?\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100(000)?\\}(, 0)?\\) += 0 \\(Timeout\\)$" - r[4] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$" + s[4] = "+++ exited with 0 +++" + lines = 4 fail = 0 } -NR > lines { exit 1 } - -{ - if (match($0, r[NR])) - next - - print "Line " NR " does not match." - fail = 1 -} - -END { - if (fail == 0 && NR != lines) { - fail = 1 - print "Expected " lines " lines, found " NR " line(s)." - } - exit fail -} +@include "match.awk" |