diff options
-rw-r--r-- | BUILD | 5 | ||||
-rw-r--r-- | WORKSPACE | 3 | ||||
-rw-r--r-- | src/test/shell/bazel/BUILD | 13 | ||||
-rwxr-xr-x | src/test/shell/bazel/bound_targets_test.sh | 28 | ||||
-rwxr-xr-x | src/test/shell/bazel/testenv.sh | 3 |
5 files changed, 50 insertions, 2 deletions
@@ -13,7 +13,10 @@ filegroup( filegroup( name = "workspace-file", srcs = [":WORKSPACE"], - visibility = ["//tools/cpp/test:__pkg__"], + visibility = [ + "//src/test/shell/bazel:__pkg__", + "//tools/cpp/test:__pkg__", + ], ) filegroup( @@ -31,3 +31,6 @@ docker_repository() # scripts/workspace_user.sh and uncomment the next two lines. # load("/WORKSPACE.user", "android_repositories") # android_repositories() + +# This allows rules written in skylark to locate apple build tools. +bind(name = "xcrunwrapper", actual = "@bazel_tools//tools/objc:xcrunwrapper") diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD index 3c45a3f6a8..49112206f4 100644 --- a/src/test/shell/bazel/BUILD +++ b/src/test/shell/bazel/BUILD @@ -50,7 +50,7 @@ filegroup( "//external:extdir", "//external:jdk-default", "//src:bazel", - "//src/java_tools/buildjar:JavaBuilderDeploy", + "//src/java_tools/buildjar:JavaBuilder_deploy.jar", "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar", "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:Runner_deploy.jar", "//src/java_tools/singlejar:SingleJar_deploy.jar", @@ -311,6 +311,17 @@ sh_test( data = [":test-deps"], ) +sh_test( + name = "bound_targets_test", + size = "large", + srcs = ["bound_targets_test.sh"], + data = [ + ":objc-deps", + ":test-deps", + "//:workspace-file", + ], +) + test_suite( name = "all_tests", visibility = ["//visibility:public"], diff --git a/src/test/shell/bazel/bound_targets_test.sh b/src/test/shell/bazel/bound_targets_test.sh new file mode 100755 index 0000000000..63b864c714 --- /dev/null +++ b/src/test/shell/bazel/bound_targets_test.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright 2016 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Load test environment +source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \ + || { echo "test-setup.sh not found!" >&2; exit 1; } + +function test_build_xcrunwrapper() { + rm WORKSPACE + ln -sv ${workspace_file} WORKSPACE + + bazel build //external:xcrunwrapper || fail "should build xcrunwrapper" +} + +run_suite "bound targets integration test" diff --git a/src/test/shell/bazel/testenv.sh b/src/test/shell/bazel/testenv.sh index 5689de846e..3e00e57c79 100755 --- a/src/test/shell/bazel/testenv.sh +++ b/src/test/shell/bazel/testenv.sh @@ -23,6 +23,9 @@ source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ { echo "Failed to source unittest.bash" >&2; exit 1; } +# WORKSPACE file +workspace_file="${TEST_SRCDIR}/WORKSPACE" + # Bazel bazel_tree="${TEST_SRCDIR}/src/test/shell/bazel/doc-srcs.zip" bazel="${TEST_SRCDIR}/src/bazel" |