summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/gawk/gawk-4.0.2/run-ptest.awk
blob: 6f651d81057f91ea3045275c1355c928e560563e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# The awk test suite prints test names prior to running the test and shows
# results in the form of "make" errors.
# This script post-processes the output to detect failure and print PASS
# only if there was no subsequent error message for the test.

function print_prev()
{
   if (length(testname))
      if (fail == 1)
         printf "FAIL: %s\n", testname
      else
         printf "PASS: %s\n", testname
}

{
   print $0

   if (match($0, /^(\w+)$/, result)) {
      print_prev()
      testname = result[1];
      fail = 0
   }

   if (match($0, /^make: \[(.+?)\]/)) {
      fail = 1
   }

}

END {
   print_prev()
}