]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: set `SOURCE_DATE_EPOCH` to fix failing around midnight
authorViktor Szakats <commit@vsz.me>
Mon, 15 Jul 2024 00:48:05 +0000 (02:48 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 16 Jul 2024 00:13:48 +0000 (02:13 +0200)
To make sure that `managen` called by test 1706 uses the same date as
the test expects in the `%DATE` macro.

Before this patch when tests started running before UTC midnight and
reached test 1706 after, these dates were different and the test failed.

Follow-up to 0e73b69b3dd6d174226c60406d3c4266754d70f8
Fixes #14173
Closes #14187

tests/runtests.pl

index dd0b9bc291036fb817282b41c3d791d13fc8fc8a..8a042dc00a9430a966dc97c6c6ed6d6c43a13c37 100755 (executable)
@@ -500,7 +500,9 @@ sub checksystemfeatures {
     $versretval = runclient($versioncmd);
     $versnoexec = $!;
 
-    $DATE = strftime "%Y-%m-%d", localtime;
+    my $current_time = int(time());
+    $ENV{'SOURCE_DATE_EPOCH'} = $current_time;
+    $DATE = strftime "%Y-%m-%d", gmtime($current_time);
 
     open(my $versout, "<", "$curlverout");
     @version = <$versout>;