#invoke with gnugo --mode gtp < reading.tst | awk -f regress.awk tst=reading.tst # store results of gnugo in array gtpout # store test numbers in array test to be able # to retrieve test results in same order as in gtp file BEGIN { ntest = 0; nexpect = 0; passes = 0; unexpected_pass = 0; unexpected_fail = 0; failures = 0; } /^[=?][0-9]+ /{ sub(/\r/, ""); sub(/^[=?]/, ""); num = $1; sub(/^[0-9]+ */, ""); gtpout[num] = $0; test[ntest] = num; ntest++; } /^;/{ print } END { # store test results in tst file in array expect while (getline < tst) { if (match ($0, /^#\?/)) { sub(/^#\? */, ""); expect[num] = $0; nexpect++; } else { num = $1; } } if (nexpect != ntest) { if (ntest > 0) { print "Possible crash!: expected " nexpect " results, got " ntest ". Last successful test was " test[ntest-1] "."; } else { print "Possible crash!: expected " nexpect " results, got " ntest ". Crash in first test."; } } # check results of gnugo --mode gtp for (i=0; i