test-driver: Show test duration

This commit is contained in:
Eelco Dolstra 2016-12-29 13:59:52 +01:00
parent 5b1dad79cd
commit 996e0ef777
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE

View File

@ -8,6 +8,7 @@ use IO::Pty;
use Logger;
use Cwd;
use POSIX qw(_exit dup2);
use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
$SIG{PIPE} = 'IGNORE'; # because Unix domain sockets may die unexpectedly
@ -179,7 +180,12 @@ END {
$log->close();
}
my $now1 = clock_gettime(CLOCK_MONOTONIC);
runTests;
my $now2 = clock_gettime(CLOCK_MONOTONIC);
printf STDERR "test script finished in %.2fs\n", $now2 - $now1;
exit ($nrSucceeded < $nrTests ? 1 : 0);