2016-02-18 07:11:59 -08:00
|
|
|
#**************************************************************************
|
|
|
|
#* *
|
|
|
|
#* OCaml *
|
|
|
|
#* *
|
|
|
|
#* Damien Doligez, projet Gallium, INRIA Rocquencourt *
|
|
|
|
#* *
|
|
|
|
#* Copyright 2013 Institut National de Recherche en Informatique et *
|
|
|
|
#* en Automatique. *
|
|
|
|
#* *
|
|
|
|
#* All rights reserved. This file is distributed under the terms of *
|
|
|
|
#* the GNU Lesser General Public License version 2.1, with the *
|
|
|
|
#* special exception on linking described in the file LICENSE. *
|
|
|
|
#* *
|
|
|
|
#**************************************************************************
|
2013-04-29 06:01:02 -07:00
|
|
|
|
|
|
|
function check() {
|
|
|
|
if (!in_test){
|
|
|
|
printf("error at line %d: found test result without test start\n", NR);
|
|
|
|
errored = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function clear() {
|
|
|
|
curfile = "";
|
|
|
|
in_test = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function record_pass() {
|
|
|
|
check();
|
2016-01-29 06:59:15 -08:00
|
|
|
if (!(key in RESULTS)) ++nresults;
|
2016-01-06 11:55:44 -08:00
|
|
|
RESULTS[key] = "p";
|
2016-01-17 01:54:20 -08:00
|
|
|
delete SKIPPED[curdir];
|
2013-04-29 06:01:02 -07:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
2013-05-17 08:06:37 -07:00
|
|
|
function record_skip() {
|
|
|
|
check();
|
2016-01-29 06:59:15 -08:00
|
|
|
if (!(key in RESULTS)) ++nresults;
|
2016-01-06 11:55:44 -08:00
|
|
|
RESULTS[key] = "s";
|
2016-01-17 02:14:12 -08:00
|
|
|
if (curdir in SKIPPED) SKIPPED[curdir] = 1;
|
2013-05-17 08:06:37 -07:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
2018-06-30 06:51:42 -07:00
|
|
|
function record_na() {
|
|
|
|
check();
|
|
|
|
if (!(key in RESULTS)) ++nresults;
|
|
|
|
RESULTS[key] = "n";
|
|
|
|
if (curdir in SKIPPED) SKIPPED[curdir] = 1;
|
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
2016-01-06 11:55:44 -08:00
|
|
|
# The output cares only if the test passes at least once so if a test passes,
|
|
|
|
# but then fails in a re-run triggered by a different test, ignore it.
|
2013-04-29 06:01:02 -07:00
|
|
|
function record_fail() {
|
|
|
|
check();
|
2016-01-17 01:54:20 -08:00
|
|
|
if (!(key in RESULTS) || RESULTS[key] == "s"){
|
2016-01-29 06:59:15 -08:00
|
|
|
if (!(key in RESULTS)) ++nresults;
|
2016-01-06 11:55:44 -08:00
|
|
|
RESULTS[key] = "f";
|
|
|
|
}
|
2016-01-17 01:54:20 -08:00
|
|
|
delete SKIPPED[curdir];
|
2013-04-29 06:01:02 -07:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
function record_unexp() {
|
2016-01-17 01:54:20 -08:00
|
|
|
if (!(key in RESULTS) || RESULTS[key] == "s"){
|
2016-01-29 06:59:15 -08:00
|
|
|
if (!(key in RESULTS)) ++nresults;
|
2016-01-06 11:55:44 -08:00
|
|
|
RESULTS[key] = "e";
|
|
|
|
}
|
2016-01-17 01:54:20 -08:00
|
|
|
delete SKIPPED[curdir];
|
2013-04-29 06:01:02 -07:00
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
2020-06-23 11:47:38 -07:00
|
|
|
/^> / {
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
2013-04-29 06:01:02 -07:00
|
|
|
/Running tests from '[^']*'/ {
|
|
|
|
if (in_test) record_unexp();
|
|
|
|
match($0, /Running tests from '[^']*'/);
|
|
|
|
curdir = substr($0, RSTART+20, RLENGTH - 21);
|
2016-02-17 04:27:06 -08:00
|
|
|
# Use SKIPPED[curdir] as a sentinel to detect no output
|
2016-01-17 02:14:12 -08:00
|
|
|
SKIPPED[curdir] = 0;
|
2016-01-06 11:55:44 -08:00
|
|
|
key = curdir;
|
|
|
|
DIRS[key] = key;
|
2013-04-29 06:01:02 -07:00
|
|
|
curfile = "";
|
|
|
|
}
|
|
|
|
|
2013-05-14 10:05:21 -07:00
|
|
|
/ ... testing.* ... testing/ {
|
|
|
|
printf("error at line %d: found two test results on the same line\n", NR);
|
|
|
|
errored = 1;
|
|
|
|
}
|
|
|
|
|
2013-04-29 06:01:02 -07:00
|
|
|
/^ ... testing '[^']*'/ {
|
|
|
|
if (in_test) record_unexp();
|
|
|
|
match($0, /... testing '[^']*'/);
|
|
|
|
curfile = substr($0, RSTART+13, RLENGTH-14);
|
2016-02-17 04:27:06 -08:00
|
|
|
if (match($0, /... testing '[^']*' with [^:=]*/)){
|
|
|
|
curfile = substr($0, RSTART+12, RLENGTH-12);
|
|
|
|
}
|
2016-01-06 11:55:44 -08:00
|
|
|
key = sprintf ("%s/%s", curdir, curfile);
|
|
|
|
DIRS[key] = curdir;
|
2013-04-29 06:01:02 -07:00
|
|
|
in_test = 1;
|
|
|
|
}
|
|
|
|
|
2016-01-17 01:54:20 -08:00
|
|
|
/^ ... testing (with|[^'])/ {
|
2013-04-29 06:01:02 -07:00
|
|
|
if (in_test) record_unexp();
|
2016-01-06 11:55:44 -08:00
|
|
|
key = curdir;
|
|
|
|
DIRS[key] = curdir;
|
2013-04-29 06:01:02 -07:00
|
|
|
in_test = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/=> passed/ {
|
|
|
|
record_pass();
|
|
|
|
}
|
|
|
|
|
2013-05-17 08:06:37 -07:00
|
|
|
/=> skipped/ {
|
|
|
|
record_skip();
|
|
|
|
}
|
|
|
|
|
2018-06-30 06:51:42 -07:00
|
|
|
/=> n\/a/ {
|
|
|
|
record_na();
|
|
|
|
}
|
|
|
|
|
2013-04-29 06:01:02 -07:00
|
|
|
/=> failed/ {
|
|
|
|
record_fail();
|
|
|
|
}
|
|
|
|
|
|
|
|
/=> unexpected error/ {
|
|
|
|
record_unexp();
|
|
|
|
}
|
|
|
|
|
2016-01-06 11:55:44 -08:00
|
|
|
/^re-ran / {
|
|
|
|
if (in_test){
|
|
|
|
printf("error at line %d: found re-ran inside a test\n", NR);
|
|
|
|
errored = 1;
|
|
|
|
}else{
|
|
|
|
RERAN[substr($0, 8, length($0)-7)] += 1;
|
|
|
|
++ reran;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-29 06:01:02 -07:00
|
|
|
END {
|
|
|
|
if (errored){
|
2013-05-14 10:05:21 -07:00
|
|
|
printf ("\n#### Some fatal error occurred during testing.\n\n");
|
2013-04-29 06:01:02 -07:00
|
|
|
exit (3);
|
|
|
|
}else{
|
2016-01-06 11:55:44 -08:00
|
|
|
if (!retries){
|
2016-01-17 02:14:12 -08:00
|
|
|
for (key in SKIPPED){
|
|
|
|
if (!SKIPPED[key]){
|
|
|
|
++ empty;
|
|
|
|
blanks[emptyidx++] = key;
|
|
|
|
delete SKIPPED[key];
|
|
|
|
}
|
|
|
|
}
|
2016-01-06 11:55:44 -08:00
|
|
|
for (key in RESULTS){
|
2016-01-17 01:50:09 -08:00
|
|
|
r = RESULTS[key];
|
|
|
|
if (r == "p"){
|
2016-01-06 11:55:44 -08:00
|
|
|
++ passed;
|
2016-01-17 01:50:09 -08:00
|
|
|
}else if (r == "f"){
|
2016-01-06 11:55:44 -08:00
|
|
|
++ failed;
|
|
|
|
fail[failidx++] = key;
|
2016-01-17 01:50:09 -08:00
|
|
|
}else if (r == "e"){
|
2016-01-06 11:55:44 -08:00
|
|
|
++ unexped;
|
|
|
|
unexp[unexpidx++] = key;
|
2016-01-17 01:50:09 -08:00
|
|
|
}else if (r == "s"){
|
|
|
|
++ skipped;
|
|
|
|
curdir = DIRS[key];
|
|
|
|
if (curdir in SKIPPED){
|
|
|
|
if (SKIPPED[curdir]){
|
|
|
|
SKIPPED[curdir] = 0;
|
|
|
|
skips[skipidx++] = curdir;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
skips[skipidx++] = key;
|
|
|
|
}
|
2018-06-30 06:51:42 -07:00
|
|
|
}else if (r == "n"){
|
|
|
|
++ ignored;
|
2016-01-06 11:55:44 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("\n");
|
2016-01-17 01:54:20 -08:00
|
|
|
if (skipped != 0){
|
|
|
|
printf("\nList of skipped tests:\n");
|
|
|
|
for (i=0; i < skipidx; i++) printf(" %s\n", skips[i]);
|
|
|
|
}
|
2016-01-17 02:14:12 -08:00
|
|
|
if (empty != 0){
|
|
|
|
printf("\nList of directories returning no results:\n");
|
|
|
|
for (i=0; i < empty; i++) printf(" %s\n", blanks[i]);
|
|
|
|
}
|
2018-06-30 03:21:06 -07:00
|
|
|
if (failed != 0){
|
|
|
|
printf("\nList of failed tests:\n");
|
|
|
|
for (i=0; i < failed; i++) printf(" %s\n", fail[i]);
|
|
|
|
}
|
|
|
|
if (unexped != 0){
|
|
|
|
printf("\nList of unexpected errors:\n");
|
|
|
|
for (i=0; i < unexped; i++) printf(" %s\n", unexp[i]);
|
|
|
|
}
|
2016-01-06 11:55:44 -08:00
|
|
|
printf("\n");
|
2018-06-30 03:09:34 -07:00
|
|
|
printf("Summary:\n");
|
|
|
|
printf(" %3d tests passed\n", passed);
|
|
|
|
printf(" %3d tests skipped\n", skipped);
|
|
|
|
printf(" %3d tests failed\n", failed);
|
|
|
|
printf(" %3d tests not started (parent test skipped or failed)\n",
|
|
|
|
ignored);
|
|
|
|
printf(" %3d unexpected errors\n", unexped);
|
|
|
|
printf(" %3d tests considered", nresults);
|
2018-06-30 03:14:29 -07:00
|
|
|
if (nresults != passed + skipped + ignored + failed + unexped){
|
|
|
|
printf (" (totals don't add up??)");
|
2018-06-30 03:09:34 -07:00
|
|
|
}
|
2018-06-30 03:14:29 -07:00
|
|
|
printf ("\n");
|
2018-06-30 03:09:34 -07:00
|
|
|
if (reran != 0){
|
|
|
|
printf(" %3d test dir re-runs\n", reran);
|
|
|
|
}
|
2016-01-06 11:55:44 -08:00
|
|
|
if (failed || unexped){
|
2016-01-17 02:00:18 -08:00
|
|
|
printf("#### Something failed. Exiting with error status.\n\n");
|
2016-01-06 11:55:44 -08:00
|
|
|
exit 4;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
for (key in RESULTS){
|
|
|
|
if (RESULTS[key] == "f" || RESULTS[key] == "e"){
|
|
|
|
key = DIRS[key];
|
|
|
|
if (!(key in RERUNS)){
|
|
|
|
RERUNS[key] = 1;
|
|
|
|
if (RERAN[key] < max_retries){
|
|
|
|
printf("%s\n", key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-04-29 12:15:28 -07:00
|
|
|
}
|
2013-04-29 06:01:02 -07:00
|
|
|
}
|
|
|
|
}
|