]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Regtest: add time cost statistics
authorMark Wielaard <mark@klomp.org>
Fri, 14 Apr 2023 22:59:26 +0000 (00:59 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 14 Apr 2023 22:59:34 +0000 (00:59 +0200)
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>
tests/vg_regtest.in

index 0fe63411a1c166df51fc4e018b9c790e03e59d8e..7152765ed70356c8054325126ef024d054a4d490 100755 (executable)
@@ -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("..");