diff options
author | Kristina Chodorow <kchodorow@google.com> | 2017-01-12 15:50:54 +0000 |
---|---|---|
committer | Marcel Hlopko <hlopko@google.com> | 2017-01-12 16:56:04 +0000 |
commit | 67e94c0bc80e3be1c75b3c588e8866523fa7cebb (patch) | |
tree | 1785f27a05024f91103f7e464c998691a447b121 /src/test/shell | |
parent | ee5ba64a1ca41ad55a44a85c4bc18cfdf7820b2f (diff) |
Print a nicer error message when android tests can't be run
This was creating an invalid WORKSPACE file and then erroring out with a syntax error.
--
Change-Id: I59389f565a0a4a893659df8a0c29d4a5d7377e62
Reviewed-on: https://cr.bazel.build/8171
PiperOrigin-RevId: 144324721
MOS_MIGRATED_REVID=144324721
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/maven_skylark_test.sh | 4 | ||||
-rwxr-xr-x | src/test/shell/testenv.sh | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/test/shell/bazel/maven_skylark_test.sh b/src/test/shell/bazel/maven_skylark_test.sh index 83676c0972..32538db45f 100755 --- a/src/test/shell/bazel/maven_skylark_test.sh +++ b/src/test/shell/bazel/maven_skylark_test.sh @@ -126,6 +126,10 @@ EOF function test_maven_aar_skylark() { setup_android_support + if [ -z "$ANDROID_NDK_API_LEVEL" ] || [ -z "$ANDROID_SDK_API_LEVEL" ]; then + fail "This test cannot run without Android repositories set up," \ + "see the WORKSPACE file for instructions" + fi setup_android_binary serve_artifact com.example.carnivore herbivore 1.21 aar setup_local_maven_settings_xml "http://localhost:$fileserver_port" diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh index 227ecc7503..264f32a63d 100755 --- a/src/test/shell/testenv.sh +++ b/src/test/shell/testenv.sh @@ -282,8 +282,8 @@ function setup_android_support() { done - local ANDROID_SDK_API_LEVEL=$(ls $SDK_SRCDIR/platforms | cut -d '-' -f 2 | sort -n | tail -1) - local ANDROID_NDK_API_LEVEL=$(ls $NDK_SRCDIR/platforms | cut -d '-' -f 2 | sort -n | tail -1) + ANDROID_SDK_API_LEVEL=$(ls $SDK_SRCDIR/platforms | cut -d '-' -f 2 | sort -n | tail -1) + ANDROID_NDK_API_LEVEL=$(ls $NDK_SRCDIR/platforms | cut -d '-' -f 2 | sort -n | tail -1) cat >> WORKSPACE <<EOF android_ndk_repository( name = "androidndk", |