1// Copyright (C) 2021 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 // See: http://go/android-license-faq 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20// Source code used for test 21filegroup { 22 name: "launcher-tests-src", 23 srcs: [ 24 "src/**/*.java", 25 "src/**/*.kt", 26 "multivalentTests/src/**/*.java", 27 "multivalentTests/src/**/*.kt", 28 ], 29 exclude_srcs: [ 30 ":launcher-non-quickstep-tests-src", 31 ], 32} 33 34filegroup { 35 name: "launcher3-robo-src", 36 // multivalentTests directory is a shared folder for not only robolectric converted test 37 // classes but also shared helper classes. 38 srcs: [ 39 "multivalentTests/src/**/*.java", 40 "multivalentTests/src/**/*.kt", 41 "src_deviceless/**/*.java", 42 "src_deviceless/**/*.kt", 43 ], 44} 45 46// Source code used for non-quickstep tests 47filegroup { 48 name: "launcher-non-quickstep-tests-src", 49 srcs: [ 50 "src/com/android/launcher3/nonquickstep/**/*.java", 51 "src/com/android/launcher3/nonquickstep/**/*.kt", 52 ], 53} 54 55// Source code used for oop test helpers 56filegroup { 57 name: "launcher-oop-tests-src", 58 srcs: [ 59 ":launcher-testing-helpers", 60 "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java", 61 "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java", 62 "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java", 63 "src/com/android/launcher3/dragging/TaplDragTest.java", 64 "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java", 65 "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java", 66 "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java", 67 ], 68} 69 70// Library with all the dependencies for building quickstep 71android_library { 72 name: "Launcher3TestLib", 73 defaults: [ 74 "launcher_compose_tests_defaults", 75 ], 76 srcs: [], 77 asset_dirs: ["assets"], 78 resource_dirs: ["res"], 79 static_libs: [ 80 "flag-junit-base", 81 "launcher-aosp-tapl", 82 "androidx.test.core", 83 "androidx.test.runner", 84 "androidx.test.rules", 85 "androidx.test.ext.junit", 86 "androidx.test.espresso.core", 87 "androidx.test.espresso.contrib", 88 "androidx.test.espresso.intents", 89 "androidx.test.uiautomator_uiautomator", 90 "mockito-kotlin2", 91 "mockito-target-extended-minus-junit4", 92 "launcher_log_protos_lite", 93 "truth", 94 "kotlinx_coroutines_test", 95 "platform-test-rules", 96 "testables", 97 "com_android_launcher3_flags_lib", 98 "com_android_wm_shell_flags_lib", 99 "android.appwidget.flags-aconfig-java", 100 "platform-parametric-runner-lib", 101 "kotlin-reflect", 102 ], 103 manifest: "AndroidManifest-common.xml", 104 platform_apis: true, 105 // TODO(b/319712088): re-enable use_resource_processor 106 use_resource_processor: false, 107} 108 109android_library { 110 name: "Launcher3TestResources", 111 resource_dirs: ["res"], 112 asset_dirs: ["assets"], 113 // TODO(b/319712088): re-enable use_resource_processor 114 use_resource_processor: false, 115 static_libs: [ 116 "kotlin-reflect", 117 ], 118} 119 120android_test { 121 name: "Launcher3Tests", 122 defaults: [ 123 "launcher_compose_tests_defaults", 124 ], 125 srcs: [ 126 ":launcher-tests-src", 127 ":launcher-non-quickstep-tests-src", 128 ], 129 static_libs: [ 130 "Launcher3TestLib", 131 "com_android_launcher3_flags_lib", 132 ], 133 libs: [ 134 "android.test.base.stubs.system", 135 "android.test.runner.stubs.system", 136 "android.test.mock.stubs.system", 137 ], 138 // Libraries used by mockito inline extended 139 jni_libs: [ 140 "libdexmakerjvmtiagent", 141 "libstaticjvmtiagent", 142 ], 143 use_embedded_native_libs: false, 144 compile_multilib: "both", 145 instrumentation_for: "Launcher3", 146 manifest: "AndroidManifest.xml", 147 platform_apis: true, 148 test_config: "Launcher3Tests.xml", 149 data: [":Launcher3"], 150 plugins: ["dagger2-compiler"], 151 test_suites: ["general-tests"], 152} 153 154filegroup { 155 name: "launcher-testing-helpers-robo", 156 srcs: [ 157 "src/**/*.java", 158 "src/**/*.kt", 159 "multivalentTests/src/**/*.java", 160 "multivalentTests/src/**/*.kt", 161 "src/com/android/launcher3/ui/AbstractLauncherUiTest.java", 162 "src/com/android/launcher3/ui/BaseLauncherTaplTest.java", 163 "tapl/com/android/launcher3/tapl/*.java", 164 "tapl/com/android/launcher3/tapl/*.kt", 165 ], 166 exclude_srcs: [ 167 // Test classes 168 "src/**/*Test.java", 169 "src/**/*Test.kt", 170 "src/**/RoboApiWrapper.kt", 171 "src/**/EventsRule.kt", 172 "multivalentTests/src/**/*Test.java", 173 "multivalentTests/src/**/*Test.kt", 174 ], 175} 176 177filegroup { 178 name: "launcher-testing-helpers", 179 srcs: [ 180 ":launcher-testing-helpers-robo", 181 "src/**/RoboApiWrapper.kt", 182 ], 183} 184 185android_robolectric_test { 186 enabled: true, 187 name: "Launcher3RoboTests", 188 srcs: [ 189 ":launcher3-robo-src", 190 ":launcher-testing-helpers-robo", 191 ], 192 exclude_srcs: [ 193 //"src/com/android/launcher3/util/CellContentDimensionsTest.kt", // Failing - b/316553889 194 195 // requires modification to work with inline mock maker 196 "src/com/android/launcher3/util/rule/StaticMockitoRule.java", 197 ], 198 java_resource_dirs: ["config"], 199 static_libs: [ 200 "flag-junit-base", 201 "flag-junit", 202 "com_android_launcher3_flags_lib", 203 "com_android_wm_shell_flags_lib", 204 "androidx.test.uiautomator_uiautomator", 205 "androidx.core_core-animation-testing", 206 "androidx.test.ext.junit", 207 "androidx.test.espresso.core", 208 "androidx.test.espresso.contrib", 209 "androidx.test.espresso.intents", 210 "androidx.test.rules", 211 "uiautomator-helpers", 212 "inline-mockito-robolectric-prebuilt", 213 "mockito-kotlin-nodeps", 214 "platform-parametric-runner-lib", 215 "platform-test-rules-deviceless", 216 "testables", 217 "Launcher3TestResources", 218 "SystemUISharedLib", 219 "launcher-testing-shared", 220 "android.appwidget.flags-aconfig-java", 221 ], 222 libs: [ 223 "android.test.runner.stubs.system", 224 "android.test.base.stubs.system", 225 "android.test.mock.stubs.system", 226 "truth", 227 ], 228 instrumentation_for: "Launcher3", 229 plugins: ["dagger2-compiler"], 230 strict_mode: false, 231} 232