]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Make the test output show how long each test takes by default.
authorBob Beck <beck@openssl.org>
Mon, 15 Dec 2025 21:51:18 +0000 (14:51 -0700)
committerNorbert Pocs <norbertp@openssl.org>
Wed, 17 Dec 2025 12:09:52 +0000 (13:09 +0100)
Unless we have reduced the verbosity level, or overridden it with
a HARNESS_TIMER setting.

This makes it easier to realize when you are making a test that is
starting to dominate testing time for developers, and makes it
easier for developers to see it.

For: https://github.com/openssl/project/issues/1767

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/29408)

test/run_tests.pl

index 38d38bdb5cb7b5e9a9f78d67463ab3f476e436a6..c692c03076c718b8e631510962b69d5ed8d82381 100644 (file)
@@ -46,7 +46,7 @@ if (!defined($jobs)) {
     }
     if (!defined($cpus) && -r "/proc/cpuinfo") {
         # Smells like Linux or something else attempting bug for bug
-        # compatibilty with the /proc paradigm.
+        # compatibility with the /proc paradigm.
         my $tmp = qx(grep -c ^processor /proc/cpuinfo 2>/dev/null);
         if ($? == 0 && $tmp > 0) {
             $cpus = $tmp;
@@ -77,12 +77,18 @@ $ENV{CTLOG_FILE} = rel2abs(catfile($srctop, "test", "ct", "log_list.cnf"));
 # some situations.
 $ENV{'MALLOC_PERTURB_'} = '128' if !defined $ENV{'MALLOC_PERTURB_'};
 
+my $tap_verbosity = exists $ENV{'HARNESS_VERBOSE'} ? $ENV{'HARNESS_VERBOSE'} : 0;
+# Show test times by default, unless we have lowered verbosity.
+my $tap_timer =  ($tap_verbosity >= 0) ? 1 : 0;
+# But also ensure HARNESS_TIMER is respected if it is set.
+$tap_timer = exists $ENV{'HARNESS_TIMER'} ? $ENV{'HARNESS_TIMER'} : $tap_timer;
+
 my %tapargs =
-    ( verbosity         => $ENV{HARNESS_VERBOSE} ? 1 : 0,
+    ( verbosity         => $tap_verbosity,
       lib               => [ $libdir ],
       switches          => '-w',
       merge             => 1,
-      timer             => $ENV{HARNESS_TIMER} ? 1 : 0,
+      timer             => $tap_timer,
     );
 
 if ($jobs > 1) {