From: Mark Wielaard Date: Fri, 14 Apr 2023 22:59:26 +0000 (+0200) Subject: Regtest: add time cost statistics X-Git-Tag: VALGRIND_3_21_0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7ddfc7cfd750978f405d7e2be8f76412fd1653d;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in index 0fe63411a1..7152765ed7 100755 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -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("..");