diff options
author | 2018-01-17 09:33:51 -0800 | |
---|---|---|
committer | 2018-01-17 09:35:42 -0800 | |
commit | 34e2193b3cfe32723f950332bd865503173b65b3 (patch) | |
tree | 85b8e992bd7ce852613cbb42113d05f4041328db /src/test/shell | |
parent | 12640e54eadd40f674c23ac4cbd63725e9ac3f56 (diff) |
http_archive: test patch files are tracked
Add a test verifying that changes to the patch file trigger a
a rebuild of the external repository.
Ensures soundness of the fix for Issue #3395.
Change-Id: Ida3823b7cddbe3bb54f0f0e24074e3854055f6e1
PiperOrigin-RevId: 182226112
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/external_patching_test.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/shell/bazel/external_patching_test.sh b/src/test/shell/bazel/external_patching_test.sh index bbe82df4ba..fd9c807f00 100755 --- a/src/test/shell/bazel/external_patching_test.sh +++ b/src/test/shell/bazel/external_patching_test.sh @@ -77,6 +77,21 @@ EOF grep -q 'There are' $foopath || fail "expected patch to be applied" grep env $foopath && fail "expected patch commands to be executed" || : + # Verify that changes to the patch files trigger enough rebuilding + cat > patch_foo.sh <<'EOF' +--- foo.sh.orig 2018-01-15 10:39:20.183909147 +0100 ++++ foo.sh 2018-01-15 10:43:35.331566052 +0100 +@@ -1,3 +1,3 @@ + #!/usr/bin/env sh + +-echo Here be dragons... ++echo completely differently patched +EOF + bazel build :foo.sh + foopath=`bazel info bazel-genfiles`/foo.sh + grep -q 'differently patched' $foopath \ + || fail "expected the new patch to be applied" + # Verify that changes to the patches attribute trigger enough rebuilding cat > WORKSPACE <<EOF load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |