aboutsummaryrefslogtreecommitdiff
path: root/test/rules/android_local_test/BUILD
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-10 01:06:58 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-10 01:06:58 +0000
commit91f5a4960f3c73a5e59b27bcc2f8ee4c31b08fc8 (patch)
treea58049c9682d6fd38e8408479340bf3911b87515 /test/rules/android_local_test/BUILD
parentbc67c32f96ccf8d0c503a88cbbf7b7ae91559be3 (diff)
parent9e965d6fece27a77de5377433c2f7e6999b8cc0b (diff)
downloadbazelbuild-rules_android-android14-qpr2-s2-release.tar.gz
Change-Id: Ic28eeddca3097c154d1283e0670dc1c497bfc08b
Diffstat (limited to 'test/rules/android_local_test/BUILD')
-rw-r--r--test/rules/android_local_test/BUILD69
1 files changed, 69 insertions, 0 deletions
diff --git a/test/rules/android_local_test/BUILD b/test/rules/android_local_test/BUILD
new file mode 100644
index 0000000..590a523
--- /dev/null
+++ b/test/rules/android_local_test/BUILD
@@ -0,0 +1,69 @@
+load("//rules:rules.bzl", "android_local_test")
+load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+load(":java_launcher_integration_test.bzl", "android_local_test_launcher_integration_test_suite")
+load(":java_launcher_test.bzl", "android_local_test_launcher_test_suite")
+
+package(
+ default_applicable_licenses = ["//:license"],
+ default_visibility = ["//visibility:public"],
+)
+
+licenses(["notice"])
+
+exports_files([
+ "EmptyTest.java",
+ "integration_test_stub_script.sh",
+])
+
+bzl_library(
+ name = "bzl",
+ srcs = glob(["*.bzl"]),
+ visibility = ["//visibility:private"],
+)
+
+android_local_test(
+ name = "sample_test_default_launcher",
+ srcs = ["EmptyTest.java"],
+ custom_package = "com.google.android.emptytest",
+ test_class = "com.google.android.emptytest.EmptyTest",
+ deps = [
+ "@robolectric//bazel:android-all",
+ "@rules_android_maven//:androidx_test_ext_junit",
+ "@rules_android_maven//:junit_junit",
+ ],
+)
+
+android_local_test(
+ name = "sample_test_default_launcher_integration",
+ srcs = ["EmptyTest.java"],
+ custom_package = "com.google.android.emptytest",
+ test_class = "com.google.android.emptytest.EmptyTest",
+ deps = [
+ "@robolectric//bazel:android-all",
+ "@rules_android_maven//:androidx_test_ext_junit",
+ "@rules_android_maven//:junit_junit",
+ ],
+)
+
+config_setting(
+ name = "jdk17",
+ values = {
+ "java_runtime_version": "17",
+ },
+)
+
+android_local_test_launcher_test_suite(
+ name = "android_local_test_launcher_tests",
+ expected_executable = select({
+ ":jdk17": "../remotejdk17_linux/bin/java",
+ "//conditions:default": "third_party/java/jdk/jdk-sts-k8/bin/java",
+ }),
+)
+
+android_local_test_launcher_integration_test_suite(
+ name = "android_local_test_launcher_integration_tests",
+ expected_executable = select({
+ ":jdk17": "rules_android/../remotejdk17_linux/bin/java",
+ "//conditions:default": "rules_android/third_party/java/jdk/jdk-sts-k8/bin/java",
+ }),
+)