| //######################################################################## |
| // Build FrameworksServicesTests package |
| //######################################################################## |
| |
| android_test { |
| name: "FrameworksServicesTests", |
| |
| // Include all test java files. |
| srcs: [ |
| "src/**/*.java", |
| "src/**/*.kt", |
| |
| "aidl/com/android/servicestests/aidl/INetworkStateObserver.aidl", |
| "aidl/com/android/servicestests/aidl/ICmdReceiverService.aidl", |
| |
| "test-apps/JobTestApp/src/**/*.java", |
| |
| "test-apps/SuspendTestApp/src/**/*.java", |
| ], |
| static_libs: [ |
| "frameworks-base-testutils", |
| "services.accessibility", |
| "services.appwidget", |
| "services.autofill", |
| "services.backup", |
| "services.core", |
| "services.devicepolicy", |
| "services.net", |
| "services.people", |
| "services.usage", |
| "guava", |
| "androidx.test.core", |
| "androidx.test.ext.truth", |
| "androidx.test.runner", |
| "androidx.test.rules", |
| "platform-compat-test-rules", |
| "mockito-target-minus-junit4", |
| "platform-test-annotations", |
| "ShortcutManagerTestUtils", |
| "truth-prebuilt", |
| "testables", |
| "testng", |
| "ub-uiautomator", |
| "platformprotosnano", |
| "hamcrest-library", |
| "servicestests-utils", |
| "service-appsearch", |
| "service-jobscheduler", |
| "service-permission.impl", |
| // TODO: remove once Android migrates to JUnit 4.12, |
| // which provides assertThrows |
| "testng", |
| "junit", |
| "platform-compat-test-rules", |
| ], |
| |
| aidl: { |
| local_include_dirs: ["aidl"], |
| }, |
| |
| 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"], |
| |
| certificate: "platform", |
| |
| // These are not normally accessible from apps so they must be explicitly included. |
| jni_libs: [ |
| "libbacktrace", |
| "libbase", |
| "libbinder", |
| "libc++", |
| "libcutils", |
| "libicing", |
| "liblog", |
| "liblzma", |
| "libnativehelper", |
| "libpsi", |
| "libui", |
| "libunwindstack", |
| "libutils", |
| "netd_aidl_interface-V5-cpp", |
| ], |
| |
| dxflags: ["--multi-dex"], |
| |
| optimize: { |
| enabled: false, |
| }, |
| |
| data: [ |
| ":JobTestApp", |
| ], |
| |
| java_resources: [ |
| ":PackageParserTestApp1", |
| ":PackageParserTestApp2", |
| ":PackageParserTestApp3", |
| ":PackageParserTestApp4", |
| ":apex.test", |
| ], |
| resource_zips: [":FrameworksServicesTests_apks_as_resources"], |
| } |
| |
| java_library { |
| name: "servicestests-core-utils", |
| srcs: [ |
| "src/com/android/server/pm/PackageSettingBuilder.java", |
| ], |
| static_libs: [ |
| "services.core", |
| ], |
| } |
| |
| java_library { |
| name: "servicestests-utils", |
| srcs: [ |
| "utils/**/*.java", |
| "utils/**/*.kt", |
| "utils-mockito/**/*.kt", |
| ":services.core-sources-deviceconfig-interface", |
| ], |
| 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", |
| ":services.core-sources-deviceconfig-interface", |
| ], |
| 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: [ |
| ":FrameworksCoreTests_install_complete_package_info", |
| ":FrameworksServicesTests_install_intent_filters", |
| ":FrameworksServicesTests_install_split_base", |
| ":FrameworksServicesTests_install_split_feature_a", |
| ":FrameworksServicesTests_install_uses_sdk_0", |
| ":FrameworksServicesTests_install_uses_sdk_q0", |
| ":FrameworksServicesTests_install_uses_sdk_r", |
| ":FrameworksServicesTests_install_uses_sdk_r0", |
| ":FrameworksServicesTests_install_uses_sdk_r5", |
| ], |
| 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", |
| } |