summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorNicolas Schodet2012-09-27 16:10:25 +0200
committerNicolas Schodet2012-10-17 15:20:36 +0200
commita469abc7a84f1c32cc0dfe6fe6ef535b11cda8c4 (patch)
tree85a5d4a55925f9bc69cbc7d56c31ee7b66fc7051 /common
parentcc6089a56db7a9f96a460f774cdbd382d13dd298 (diff)
common/tests: add the total number of tests done in report
Also report the number of expected fail tests.
Diffstat (limited to 'common')
-rwxr-xr-xcommon/tests/run-test.pl31
1 files changed, 25 insertions, 6 deletions
diff --git a/common/tests/run-test.pl b/common/tests/run-test.pl
index f6d9e535ca..43e7759b1b 100755
--- a/common/tests/run-test.pl
+++ b/common/tests/run-test.pl
@@ -56,6 +56,8 @@ my $lcov;
my $dir;
my $skip;
my $fail = 0;
+my $fail_expected = 0;
+my $tests = 0;
while (<STDIN>)
{
chomp;
@@ -114,9 +116,17 @@ while (<STDIN>)
}
else
{
+ $tests++;
if ($status != 0)
{
- $fail++ unless $expected;
+ if ($expected)
+ {
+ $fail_expected++;
+ }
+ else
+ {
+ $fail++;
+ }
if ($status == -1 || $status == 128 << 8) {
print "=$t: FAIL$expected command not found\n";
} elsif ($status & 127) {
@@ -137,16 +147,25 @@ while (<STDIN>)
}
}
# Print summary.
-if ($fail)
+if ($fail && $fail_expected)
+{
+ print "\n===> FAIL $fail unexpected tests (out of $tests, fail "
+ . "$fail_expected tests as expected)\n";
+}
+elsif ($fail)
+{
+ print "\n===> FAIL $fail tests (out of $tests)\n";
+}
+elsif ($fail_expected)
{
- print "\n===> FAIL $fail unexpected tests\n";
- exit 1;
+ print "\n===> PASS almost all tests (but fail $fail_expected tests as "
+ . "expected, out of $tests tests)\n";
}
else
{
- print "\n===> PASS all tests\n";
- exit 0;
+ print "\n===> PASS all $tests tests\n";
}
+exit $fail ? 1 : 0;
sub cov_macro
{