aboutsummaryrefslogtreecommitdiff
path: root/test/rules/android_local_test/BUILD
diff options
context:
space:
mode:
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",
+ }),
+)