aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar Adam Michael <ajmichael@google.com>2017-03-08 08:47:14 +0000
committerGravatar Vladimir Moskva <vladmos@google.com>2017-03-08 10:52:14 +0000
commita5ba0d3711e84ef47525d6b7fe1ca9871853c1a6 (patch)
tree8bda0395a2b9125a1e7781bdb94f79a8378638dc /src/test
parentef651712e9bee512967d8ec6ac6d63fda41addab (diff)
Add an android integration test for missing environment variables.
This is a test for https://bazel-review.googlesource.com/c/9213 and would have caught https://github.com/bazelbuild/bazel/issues/2621. -- Change-Id: I6c0fb10cc86f6f0dab02e931e9710e1b5168320c Reviewed-on: https://cr.bazel.build/9270 PiperOrigin-RevId: 149512997 MOS_MIGRATED_REVID=149512997
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/shell/bazel/android/android_integration_test.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/shell/bazel/android/android_integration_test.sh b/src/test/shell/bazel/android/android_integration_test.sh
index 020c0197b8..323d24566d 100755
--- a/src/test/shell/bazel/android/android_integration_test.sh
+++ b/src/test/shell/bazel/android/android_integration_test.sh
@@ -354,6 +354,18 @@ EOF
"build with --android_sdk failed"
}
+# Regression test for https://github.com/bazelbuild/bazel/issues/2621.
+function test_android_sdk_repository_returns_null_if_env_vars_missing() {
+ create_new_workspace
+ setup_android_sdk_support
+ ANDROID_HOME=/does_not_exist_1 bazel build @androidsdk//:files || \
+ fail "Build failed"
+ sed -i -e 's/path =/#path =/g' WORKSPACE
+ ANDROID_HOME=/does_not_exist_2 bazel build @androidsdk//:files && \
+ fail "Build should have failed"
+ ANDROID_HOME=$ANDROID_SDK bazel build @androidsdk//:files || "Build failed"
+}
+
# ndk r10 and earlier
if [[ ! -r "${TEST_SRCDIR}/androidndk/ndk/RELEASE.TXT" ]]; then
# ndk r11 and later