summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk')
-rw-r--r--meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk b/meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk
new file mode 100644
index 0000000000..6f651d8105
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk
@@ -0,0 +1,32 @@
1# The awk test suite prints test names prior to running the test and shows
2# results in the form of "make" errors.
3# This script post-processes the output to detect failure and print PASS
4# only if there was no subsequent error message for the test.
5
6function print_prev()
7{
8 if (length(testname))
9 if (fail == 1)
10 printf "FAIL: %s\n", testname
11 else
12 printf "PASS: %s\n", testname
13}
14
15{
16 print $0
17
18 if (match($0, /^(\w+)$/, result)) {
19 print_prev()
20 testname = result[1];
21 fail = 0
22 }
23
24 if (match($0, /^make: \[(.+?)\]/)) {
25 fail = 1
26 }
27
28}
29
30END {
31 print_prev()
32}