diff options
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/android/android_integration_test.sh | 15 | ||||
-rwxr-xr-x | src/test/shell/bazel/external_skylark_load_test.sh | 57 |
2 files changed, 72 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 c838c0eb91..7d3dd34f4f 100755 --- a/src/test/shell/bazel/android/android_integration_test.sh +++ b/src/test/shell/bazel/android/android_integration_test.sh @@ -159,6 +159,21 @@ function check_num_sos() { assert_equals "11" "$num_sos" } +function test_sdk_library_deps() { + create_new_workspace + setup_android_support + + mkdir -p java/a + cat > java/a/BUILD<<EOF +android_library( + name = "a", + deps = ["//external:android/mediarouter_v7"], +) +EOF + + bazel build --nobuild //java/a:a || fail "build failed" +} + function test_android_binary() { create_new_workspace setup_android_support diff --git a/src/test/shell/bazel/external_skylark_load_test.sh b/src/test/shell/bazel/external_skylark_load_test.sh index bd8318ad87..a198371595 100755 --- a/src/test/shell/bazel/external_skylark_load_test.sh +++ b/src/test/shell/bazel/external_skylark_load_test.sh @@ -236,4 +236,61 @@ EOF expect_log "@r1//foo:bar" } +function test_aspects_and_skylark_repositories() { +cat > WORKSPACE <<EOF +bind(name="x1", actual="//:x1") +load("//:repo.bzl", "repo") +bind(name="x2", actual="//:x2") +EOF + +cat > BUILD <<EOF +load("//:rule.bzl", "test_rule") + +filegroup(name = "x1") +filegroup(name = "x2") +test_rule( + name = "tr", + deps = ["//external:x1", "//external:x2"], +) +EOF + +cat > repo.bzl <<EOF +def repo(): + pass +EOF + +cat > rule.bzl <<EOF +def test_aspect_impl(target, ctx): + return struct() + +test_aspect = aspect( + attrs = { + "_x": attr.label_list(default = [ + Label("//external:x1"), + Label("//external:x2"), + ]), + }, + implementation = test_aspect_impl, +) + +def test_rule_impl(ctx): + return struct() + +test_rule = rule( + attrs = { + "deps": attr.label_list( + allow_files = True, + allow_rules = [ + "filegroup", + ], + aspects = [test_aspect], + ), + }, + implementation = test_rule_impl, +) +EOF + + bazel build //:tr || fail "build failed" +} + run_suite "Test Skylark loads from/in external repositories" |