# 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() }