aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2018-02-26 06:09:04 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-26 06:11:01 -0800
commitc0e52bce8278243e8fd43f8307b413114d3ebbba (patch)
treece36021ee46558fd182709ed661128059116e04a /src/test/shell
parentd6443d24a4bed112f258b3d6c0cef6e7845bc703 (diff)
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
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/bazel_bootstrap_distfile_test.sh5
1 files changed, 4 insertions, 1 deletions
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"
}