1//######################################################################## 2// Build WmTests package 3//######################################################################## 4 5package { 6 // See: http://go/android-license-faq 7 // A large-scale-change added 'default_applicable_licenses' to import 8 // all of the 'license_kinds' from "frameworks_base_license" 9 // to get the below license kinds: 10 // SPDX-license-identifier-Apache-2.0 11 default_applicable_licenses: ["frameworks_base_license"], 12} 13 14// Include all test java files. 15filegroup { 16 name: "wmtests-sources", 17 srcs: [ 18 "src/**/*.java", 19 ], 20} 21 22java_genrule { 23 name: "wmtests.protologsrc", 24 srcs: [ 25 ":protolog-impl", 26 ":protolog-groups", 27 ":wmtests-sources", 28 ], 29 tools: ["protologtool"], 30 cmd: "$(location protologtool) transform-protolog-calls " + 31 "--protolog-class com.android.internal.protolog.ProtoLog " + 32 "--loggroups-class com.android.internal.protolog.WmProtoLogGroups " + 33 "--loggroups-jar $(location :protolog-groups) " + 34 // Used for the ProtoLogIntegrationTest, where don't test decoding or writing to file 35 // so the parameters below are irrelevant. 36 "--viewer-config-file-path /some/unused/file/path.pb " + 37 "--legacy-viewer-config-file-path /some/unused/file/path.json.gz " + 38 "--legacy-output-file-path /some/unused/file/path.winscope " + 39 // END of irrelevant params. 40 "--output-srcjar $(out) " + 41 "$(locations :wmtests-sources)", 42 out: ["wmtests.protolog.srcjar"], 43} 44 45android_test { 46 name: "WmTests", 47 48 // We only want this apk build for tests. 49 srcs: [ 50 ":wmtests-sources", 51 "src/**/*.aidl", 52 ], 53 54 static_libs: [ 55 "frameworks-base-testutils", 56 "services.core", 57 "service-permission.stubs.system_server", 58 "androidx.test.runner", 59 "androidx.test.rules", 60 "flickerlib", 61 "junit-params", 62 "mockito-target-extended-minus-junit4", 63 "platform-test-annotations", 64 "servicestests-utils", 65 "testng", 66 "truth", 67 "testables", 68 "hamcrest-library", 69 "flag-junit", 70 "platform-compat-test-rules", 71 "CtsSurfaceValidatorLib", 72 "service-sdksandbox.impl", 73 "com.android.window.flags.window-aconfig-java", 74 "android.view.inputmethod.flags-aconfig-java", 75 "flag-junit", 76 ], 77 78 libs: [ 79 "android.hardware.power-V1-java", 80 "android.test.mock.stubs.system", 81 "android.test.base.stubs.system", 82 "android.test.runner.stubs.system", 83 ], 84 85 defaults: [ 86 "modules-utils-testable-device-config-defaults", 87 ], 88 89 // These are not normally accessible from apps so they must be explicitly included. 90 jni_libs: [ 91 "libdexmakerjvmtiagent", 92 "libstaticjvmtiagent", 93 ], 94 95 platform_apis: true, 96 test_suites: [ 97 "device-tests", 98 "automotive-tests", 99 ], 100 101 certificate: "platform", 102 103 dxflags: ["--multi-dex"], 104 105 optimize: { 106 enabled: false, 107 }, 108 109 data: [ 110 ":OverlayTestApp", 111 ], 112} 113 114test_module_config { 115 name: "WmTests_server_policy_Presubmit", 116 base: "WmTests", 117 test_suites: [ 118 "automotive-tests", 119 "device-tests", 120 ], 121 include_filters: ["com.android.server.policy."], 122 include_annotations: ["android.platform.test.annotations.Presubmit"], 123} 124 125test_module_config { 126 name: "WmTests_server_policy", 127 base: "WmTests", 128 test_suites: [ 129 "automotive-tests", 130 "device-tests", 131 ], 132 include_filters: ["com.android.server.policy."], 133} 134 135test_module_config { 136 name: "WmTests_wm_utils_Presubmit", 137 base: "WmTests", 138 test_suites: [ 139 "automotive-tests", 140 "device-tests", 141 ], 142 include_filters: ["com.android.server.wm.utils"], 143 include_annotations: ["android.platform.test.annotations.Presubmit"], 144} 145