blob: 3a9f4ad200bcc37f9d364741cb82ffada5e1dae4 [file] [log] [blame]
Sunny Goyalf5c42ea2021-03-12 16:00:40 -08001// 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.
Bob Badoura7548b52022-01-27 22:04:48 -080014
Bob Badour390b27e2021-03-19 04:22:23 -070015package {
16 // See: http://go/android-license-faq
Bob Badoura7548b52022-01-27 22:04:48 -080017 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour390b27e2021-03-19 04:22:23 -070018}
19
Sunny Goyal4af8cf92021-07-29 15:48:24 -070020// Source code used for test
Sunny Goyalf5c42ea2021-03-12 16:00:40 -080021filegroup {
Sunny Goyal4af8cf92021-07-29 15:48:24 -070022 name: "launcher-tests-src",
Thales Limaa1012902022-01-13 17:58:42 +000023 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080024 "src/**/*.java",
25 "src/**/*.kt",
Kevin Lima14145a2024-03-19 18:56:34 +000026 ":launcher3-robo-src",
Thales Limaa1012902022-01-13 17:58:42 +000027 ],
Thales Lima9938c2f2022-07-25 14:38:16 +010028 exclude_srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080029 ":launcher-non-quickstep-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +010030 ],
31}
32
Kevin Lima14145a2024-03-19 18:56:34 +000033filegroup {
34 name: "launcher3-robo-src",
35 // multivalentTests directory is a shared folder for not only robolectric converted test
36 // classes but also shared helper classes.
37 srcs: [
38 "multivalentTests/src/**/*.java",
39 "multivalentTests/src/**/*.kt",
40 ],
41}
42
Thales Lima9938c2f2022-07-25 14:38:16 +010043// Source code used for non-quickstep tests
44filegroup {
45 name: "launcher-non-quickstep-tests-src",
46 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080047 "src/com/android/launcher3/nonquickstep/**/*.java",
48 "src/com/android/launcher3/nonquickstep/**/*.kt",
Thales Lima9938c2f2022-07-25 14:38:16 +010049 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -070050}
51
52// Source code used for oop test helpers
53filegroup {
54 name: "launcher-oop-tests-src",
55 srcs: [
Sunny Goyal5ca50492024-03-18 14:50:48 -070056 ":launcher-testing-helpers",
Colin Crossf156b6b2024-01-11 14:03:12 -080057 "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java",
58 "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java",
59 "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java",
60 "src/com/android/launcher3/dragging/TaplDragTest.java",
61 "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080062 "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java",
63 "src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java",
64 "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070065 ],
66}
67
68// Library with all the dependencies for building quickstep
69android_library {
70 name: "Launcher3TestLib",
Colin Crossf156b6b2024-01-11 14:03:12 -080071 srcs: [],
Sebastian Francoe7c3d3d2023-01-10 10:47:46 -060072 asset_dirs: ["assets"],
Sunny Goyal4af8cf92021-07-29 15:48:24 -070073 resource_dirs: ["res"],
74 static_libs: [
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -070075 "flag-junit-base",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070076 "launcher-aosp-tapl",
Sunny Goyal177785e2021-07-29 15:48:24 -070077 "androidx.test.core",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070078 "androidx.test.runner",
79 "androidx.test.rules",
80 "androidx.test.ext.junit",
81 "androidx.test.espresso.core",
82 "androidx.test.espresso.contrib",
83 "androidx.test.espresso.intents",
84 "androidx.test.uiautomator_uiautomator",
Brian Isganitis06139e02023-10-03 16:02:39 -040085 "mockito-kotlin2",
Anushree Ganjam94efd7a2023-08-24 18:28:19 -070086 "mockito-target-extended-minus-junit4",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070087 "launcher_log_protos_lite",
Krzysztof KosiƄski6e3b7a62023-10-10 06:50:28 +000088 "truth",
vadimt13839e42022-02-17 13:56:06 -080089 "platform-test-rules",
Pat Manningda696612023-02-17 15:06:58 +000090 "testables",
Anushree Ganjam2a14b972023-08-30 13:31:10 -070091 "com_android_launcher3_flags_lib",
Jeremy Sim9e44e372023-10-10 14:54:39 -070092 "com_android_wm_shell_flags_lib",
Willie Koomsonfedc18e2023-11-07 22:31:46 +000093 "android.appwidget.flags-aconfig-java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070094 ],
95 manifest: "AndroidManifest-common.xml",
96 platform_apis: true,
Colin Crossf156b6b2024-01-11 14:03:12 -080097 // TODO(b/319712088): re-enable use_resource_processor
98 use_resource_processor: false,
Sunny Goyal4af8cf92021-07-29 15:48:24 -070099}
100
My Name5b59e752021-12-15 20:54:45 -0500101android_library {
102 name: "Launcher3TestResources",
103 resource_dirs: ["res"],
Colin Crossf156b6b2024-01-11 14:03:12 -0800104 // TODO(b/319712088): re-enable use_resource_processor
105 use_resource_processor: false,
My Name5b59e752021-12-15 20:54:45 -0500106}
107
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700108android_test {
109 name: "Launcher3Tests",
110 srcs: [
111 ":launcher-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +0100112 ":launcher-non-quickstep-tests-src",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700113 ],
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700114 static_libs: [
115 "Launcher3TestLib",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700116 "com_android_launcher3_flags_lib",
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700117 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700118 libs: [
119 "android.test.base",
120 "android.test.runner",
121 "android.test.mock",
122 ],
Anushree Ganjam94efd7a2023-08-24 18:28:19 -0700123 // Libraries used by mockito inline extended
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700124 jni_libs: [
125 "libdexmakerjvmtiagent",
126 "libstaticjvmtiagent",
127 ],
128 use_embedded_native_libs: false,
129 compile_multilib: "both",
130 instrumentation_for: "Launcher3",
131 manifest: "AndroidManifest.xml",
132 platform_apis: true,
133 test_config: "Launcher3Tests.xml",
Vadim Tryshev990a32e2023-03-02 21:51:21 +0000134 data: [":Launcher3"],
135 test_suites: ["general-tests"],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800136}
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000137
138// Shared between tests and launcher
139android_library {
140 name: "launcher-testing-shared",
141 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800142 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.java",
Uwais Ashraff7c9e2c2024-02-28 11:47:56 +0000143 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.kt",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000144 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800145 resource_dirs: [],
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000146 manifest: "multivalentTests/shared/AndroidManifest.xml",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000147 sdk_version: "current",
148 min_sdk_version: min_launcher3_sdk_version,
Colin Crossf156b6b2024-01-11 14:03:12 -0800149}
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000150
151filegroup {
152 name: "launcher-testing-helpers",
153 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800154 "src/**/*.java",
155 "src/**/*.kt",
156 "multivalentTests/src/**/*.java",
157 "multivalentTests/src/**/*.kt",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +0000158 "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
159 "tapl/com/android/launcher3/tapl/*.java",
160 "tapl/com/android/launcher3/tapl/*.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000161 ],
162 exclude_srcs: [
163 // Test classes
164 "src/**/*Test.java",
165 "src/**/*Test.kt",
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000166 "multivalentTests/src/**/*Test.java",
167 "multivalentTests/src/**/*Test.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000168 ],
169}
170
171android_library {
172 name: "Launcher3Lib",
173 srcs: [
174 ":launcher-src",
175 ":launcher-src_shortcuts_overrides",
176 ":launcher-src_ui_overrides",
177 ],
178 static_libs: [
179 "Launcher3CommonDepsLib",
180 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800181 // TODO(b/319712088): re-enable use_resource_processor
182 use_resource_processor: false,
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000183}
184
185android_robolectric_test {
186 enabled: true,
187 name: "Launcher3RoboTests",
188 srcs: [
Kevin Lima14145a2024-03-19 18:56:34 +0000189 ":launcher3-robo-src",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000190
191 // Test util classes
192 ":launcher-testing-helpers",
193 ":launcher-testing-shared",
194 ],
195 exclude_srcs: [
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000196 //"src/com/android/launcher3/util/CellContentDimensionsTest.kt", // Failing - b/316553889
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000197
198 // requires modification to work with inline mock maker
199 "src/com/android/launcher3/util/rule/StaticMockitoRule.java",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000200 ],
201 java_resource_dirs: ["config"],
202 static_libs: [
203 "flag-junit-base",
204 "com_android_launcher3_flags_lib",
205 "com_android_wm_shell_flags_lib",
206 "androidx.test.uiautomator_uiautomator",
207 "androidx.core_core-animation-testing",
208 "androidx.test.ext.junit",
Uwais Ashraff7c9e2c2024-02-28 11:47:56 +0000209 "mockito-robolectric-prebuilt",
210 "mockito-kotlin2",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000211 "platform-parametric-runner-lib",
212 "testables",
213 "Launcher3TestResources",
214 "SystemUISharedLib",
215 "launcher-testing-shared",
216 ],
217 libs: [
218 "android.test.runner",
219 "android.test.base",
220 "android.test.mock",
221 "truth",
222 ],
223 instrumentation_for: "Launcher3",
224 upstream: true,
225}