| //######################################################################## |
| // Build FrameworksServicesTests package |
| //######################################################################## |
| |
| java_defaults { |
| name: "FrameworksServicesTests-jni-defaults", |
| jni_libs: [ |
| "libservicestestjni", |
| ], |
| } |
| |
| package { |
| // See: http://go/android-license-faq |
| // A large-scale-change added 'default_applicable_licenses' to import |
| // all of the 'license_kinds' from "frameworks_base_license" |
| // to get the below license kinds: |
| // SPDX-license-identifier-Apache-2.0 |
| default_applicable_licenses: ["frameworks_base_license"], |
| } |
| |
| android_test { |
| name: "FrameworksServicesTests", |
| defaults: [ |
| "FrameworksServicesTests-jni-defaults", |
| ], |
| |
| // Include all test java files. |
| srcs: [ |
| "src/**/*.java", |
| "src/**/*.kt", |
| |
| "test-apps/JobTestApp/src/**/*.java", |
| |
| "test-apps/SuspendTestApp/src/**/*.java", |
| ], |
| static_libs: [ |
| "frameworks-base-testutils", |
| "services.accessibility", |
| "services.appwidget", |
| "services.autofill", |
| "services.contentcapture", |
| "services.backup", |
| "services.companion", |
| "services.core", |
| "services.credentials", |
| "services.devicepolicy", |
| "services.flags", |
| "services.net", |
| "services.people", |
| "services.usage", |
| "service-permission.stubs.system_server", |
| "guava", |
| "guava-android-testlib", |
| "androidx.test.core", |
| "androidx.test.ext.truth", |
| "androidx.test.runner", |
| "androidx.test.rules", |
| "androidx.test.ext.junit", |
| "cts-wm-util", |
| "platform-compat-test-rules", |
| "mockito-target-minus-junit4", |
| "platform-test-annotations", |
| "ShortcutManagerTestUtils", |
| "truth", |
| "testables", |
| "androidx.test.uiautomator_uiautomator", |
| "platformprotosnano", |
| "framework-protos", |
| "hamcrest-library", |
| "servicestests-utils", |
| "service-jobscheduler", |
| // TODO: remove once Android migrates to JUnit 4.12, |
| // which provides assertThrows |
| "testng", |
| "truth", |
| "junit", |
| "junit-params", |
| "ActivityContext", |
| "coretests-aidl", |
| "securebox", |
| "flag-junit", |
| "ravenwood-junit", |
| ], |
| |
| libs: [ |
| "android.hardware.power-V1-java", |
| "android.hardware.tv.cec-V1.0-java", |
| "android.hardware.vibrator-V2-java", |
| "android.hidl.manager-V1.0-java", |
| "android.test.mock", |
| "android.test.base", |
| "android.test.runner", |
| ], |
| |
| platform_apis: true, |
| |
| test_suites: [ |
| "device-tests", |
| "automotive-tests", |
| ], |
| |
| certificate: "platform", |
| |
| // These are not normally accessible from apps so they must be explicitly included. |
| jni_libs: [ |
| "libbase", |
| "libbinder", |
| "libc++", |
| "libcutils", |
| "liblog", |
| "liblzma", |
| "libnativehelper", |
| "libpsi", |
| "libui", |
| "libunwindstack", |
| "libutils", |
| "netd_aidl_interface-V5-cpp", |
| ], |
| |
| dxflags: ["--multi-dex"], |
| |
| optimize: { |
| enabled: false, |
| }, |
| |
| data: [ |
| ":JobTestApp", |
| ":SimpleServiceTestApp1", |
| ":SimpleServiceTestApp2", |
| ":SimpleServiceTestApp3", |
| ":SuspendTestApp", |
| ":MediaButtonReceiverHolderTestHelperApp", |
| "data/broken_shortcut.xml", |
| ], |
| |
| java_resources: [ |
| ":com.android.apex.cts.shim.v1_prebuilt", |
| ":com.android.apex.cts.shim.v2_different_certificate_prebuilt", |
| ":com.android.apex.cts.shim.v2_unsigned_apk_container_prebuilt", |
| ], |
| resource_zips: [":FrameworksServicesTests_apks_as_resources"], |
| } |
| |
| android_ravenwood_test { |
| name: "FrameworksServicesTestsRavenwood", |
| libs: [ |
| "android.test.mock", |
| ], |
| static_libs: [ |
| "androidx.annotation_annotation", |
| "androidx.test.rules", |
| "mockito_ravenwood", |
| "services.core", |
| ], |
| srcs: [ |
| "src/com/android/server/uri/**/*.java", |
| ], |
| auto_gen_config: true, |
| } |
| |
| java_library { |
| name: "servicestests-core-utils", |
| srcs: [ |
| "src/com/android/server/am/DeviceConfigSession.java", |
| "src/com/android/server/pm/PackageSettingBuilder.java", |
| "src/com/android/server/pm/parsing/TestPackageParser2.kt", |
| ], |
| static_libs: [ |
| "services.core", |
| "compatibility-device-util-axt", |
| ], |
| } |
| |
| java_library { |
| name: "servicestests-dpm-utils", |
| srcs: [ |
| "src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java", |
| "src/com/android/server/devicepolicy/DevicePolicyManagerTestable.java", |
| "src/com/android/server/devicepolicy/DpmMockContext.java", |
| "src/com/android/server/devicepolicy/DpmTestBase.java", |
| "src/com/android/server/devicepolicy/DpmTestUtils.java", |
| "src/com/android/server/devicepolicy/DummyDeviceAdmins.java", |
| "src/com/android/server/devicepolicy/MockSystemServices.java", |
| "src/com/android/server/devicepolicy/MockUtils.java", |
| ], |
| libs: [ |
| "android.test.mock", |
| "android.test.base", |
| "mockito-target-minus-junit4", |
| ], |
| static_libs: [ |
| "frameworks-base-testutils", |
| "androidx.test.core", |
| "androidx.test.ext.truth", |
| "androidx.test.rules", |
| "services.core", |
| "services.devicepolicy", |
| ], |
| } |
| |
| java_library { |
| name: "servicestests-utils", |
| srcs: [ |
| "utils/**/*.java", |
| "utils/**/*.kt", |
| "utils-mockito/**/*.kt", |
| ], |
| static_libs: [ |
| "junit", |
| "mockito-target-minus-junit4", |
| ], |
| libs: [ |
| "android.test.runner", |
| ], |
| } |
| |
| java_library { |
| name: "servicestests-utils-mockito-extended", |
| srcs: [ |
| "utils/**/*.java", |
| "utils/**/*.kt", |
| "utils-mockito/**/*.kt", |
| ], |
| static_libs: [ |
| "junit", |
| "mockito-target-extended-minus-junit4", |
| ], |
| libs: [ |
| "android.test.runner", |
| ], |
| } |
| |
| filegroup { |
| name: "servicestests-SuspendTestApp-files", |
| srcs: [ |
| "src/com/android/server/pm/SuspendPackagesTest.java", |
| ], |
| } |
| |
| // Rules to copy all the test apks to the intermediate raw resource directory |
| java_genrule { |
| name: "FrameworksServicesTests_apks_as_resources", |
| srcs: [ |
| ":FrameworksServicesTests_install_split_base", |
| ":FrameworksServicesTests_install_split_feature_a", |
| ], |
| out: ["FrameworkServicesTests_apks_as_resources.res.zip"], |
| tools: ["soong_zip"], |
| |
| cmd: "mkdir -p $(genDir)/res/raw && " + |
| "for i in $(in); do " + |
| " x=$${i##*FrameworksCoreTests_}; cp $$i $(genDir)/res/raw/$${x%.apk};" + |
| " x=$${i##*FrameworksServicesTests_}; cp $$i $(genDir)/res/raw/$${x%.apk};" + |
| "done && " + |
| "$(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res", |
| } |