From c0e52bce8278243e8fd43f8307b413114d3ebbba Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 26 Feb 2018 06:09:04 -0800 Subject: Add a regression test for SOURCE_DATE_EPOCH Since bazel 0.10.0 and 0.11.0 were shipped with SOURCE_DATE_EPOCH interpreted as Kiloseconds rather than seconds since the epoch as it should, extend our test to also verify that the correct year is shown. Change-Id: I613d1a967e4e36019b55b720a4b9b7757cfb4b60 PiperOrigin-RevId: 187009490 --- src/test/shell/bazel/bazel_bootstrap_distfile_test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh index 783ed88a7d..7c4944b5b9 100755 --- a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh +++ b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh @@ -43,7 +43,7 @@ function test_bootstrap() { mkdir -p "${WRKDIR}" || fail "Could not create workdir" trap "rm -rf \"$WRKDIR\"" EXIT cd "${WRKDIR}" || fail "Could not change to work directory" - export SOURCE_DATE_EPOCH=1501234567 + export SOURCE_DATE_EPOCH=1501234567 # Fri Jul 28 09:36:07 UTC 2017 _log_progress "unzip" unzip -q "${DISTFILE}" _log_progress "bootstrap" @@ -54,6 +54,9 @@ function test_bootstrap() { ./output/bazel shutdown _log_progress "assert" expect_log "${SOURCE_DATE_EPOCH}" + expect_log 2017 # The year 1501234567 seconds since the epoch + expect_not_log 49542 # The year 1501234567000 seconds since the epoch + expect_not_log 1970 # The year 1501234 seconds since the epoch cd "${olddir}" _log_progress "done" } -- cgit v1.2.3