Regtest: add time cost statistics

Add running time of each (sub) directory in seconds

https://bugs.kde.org/show_bug.cgi?id=467036

Contributed-by: Jojo R <rjiejie@linux.alibaba.com>
This commit is contained in:
Mark Wielaard 2023-04-15 00:59:26 +02:00
parent 16be0ca4ba
commit f7ddfc7cfd

View File

@ -641,6 +641,7 @@ sub test_one_dir($$)
my @fs = glob "*";
my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
my $tests_start_time = time;
if ($found_tests) {
print "-- Running tests in $full_dir $dashes\n";
}
@ -652,7 +653,11 @@ sub test_one_dir($$)
}
}
if ($found_tests) {
print "-- Finished tests in $full_dir $dashes\n";
my $tests_cost_time = time - $tests_start_time;
my $end_time = "(in $tests_cost_time sec)";
my $end_dashes = "-" x (50 - (length $full_dir)
- (length $end_time) - 1);
print "-- Finished tests in $full_dir $end_time $end_dashes\n";
}
chdir("..");