diff options
Diffstat (limited to 'java/tests')
-rw-r--r-- | java/tests/Android.bp | 36 | ||||
-rw-r--r-- | java/tests/AndroidManifest.xml | 3 | ||||
-rw-r--r-- | java/tests/README.md | 7 |
3 files changed, 33 insertions, 13 deletions
diff --git a/java/tests/Android.bp b/java/tests/Android.bp index 29ecd95d..e4d24eb5 100644 --- a/java/tests/Android.bp +++ b/java/tests/Android.bp @@ -1,11 +1,26 @@ +// +// Copyright (C) 2023 The Android Open Source Project +// +// 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. +// + package { - // See: http://go/android-license-faq - default_applicable_licenses: ["packages_modules_IntentResolver_license"], + default_applicable_licenses: ["Android-Apache-2.0"], } android_test { name: "IntentResolverUnitTests", - + manifest: "AndroidManifest.xml", // Include all test java files. srcs: ["src/**/*.java", "src/**/*.kt"], @@ -17,10 +32,10 @@ android_test { "framework-res", ], + resource_dirs: ["res"], + test_config: "AndroidTest.xml", static_libs: [ - "IntentResolver-core", "androidx.test.core", - "androidx.test.rules", "androidx.test.ext.junit", "androidx.test.ext.truth", "androidx.test.espresso.contrib", @@ -28,19 +43,18 @@ android_test { "androidx.test.rules", "androidx.lifecycle_lifecycle-common-java8", "androidx.lifecycle_lifecycle-extensions", - "androidx.lifecycle_lifecycle-runtime-ktx", "androidx.lifecycle_lifecycle-runtime-testing", + "IntentResolver-core", + "junit", "kotlinx_coroutines_test", "mockito-target-minus-junit4", "testables", "truth-prebuilt", ], - min_sdk_version: "current", - target_sdk_version: "current", plugins: ["dagger2-compiler"], test_suites: ["general-tests"], sdk_version: "core_platform", - compile_multilib: "both", - - dont_merge_manifests: true, + min_sdk_version: "current", + target_sdk_version: "current", + platform_apis: true, } diff --git a/java/tests/AndroidManifest.xml b/java/tests/AndroidManifest.xml index 4517a60c..ae6a2205 100644 --- a/java/tests/AndroidManifest.xml +++ b/java/tests/AndroidManifest.xml @@ -34,8 +34,7 @@ </application> <instrumentation android:name="android.testing.TestableInstrumentation" - android:targetPackage="com.android.intentresolver.tests" - android:label="Tests for IntentResolver"> + android:targetPackage="com.android.intentresolver.tests"> </instrumentation> </manifest> diff --git a/java/tests/README.md b/java/tests/README.md new file mode 100644 index 00000000..b42e8d27 --- /dev/null +++ b/java/tests/README.md @@ -0,0 +1,7 @@ + +__ABOUT__ + +This is package is configured as a self-instrumenting test APK. The IntentResolver application code +is bundled in and the instrumentation APK targets itself. This is used for in-process mocking and +verification involving live components that many tests rely on. + |