Sunny Goyal | f5c42ea | 2021-03-12 16:00:40 -0800 | [diff] [blame] | 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. |
Bob Badour | a7548b5 | 2022-01-27 22:04:48 -0800 | [diff] [blame] | 14 | |
Bob Badour | 390b27e | 2021-03-19 04:22:23 -0700 | [diff] [blame] | 15 | package { |
| 16 | // See: http://go/android-license-faq |
Bob Badour | a7548b5 | 2022-01-27 22:04:48 -0800 | [diff] [blame] | 17 | default_applicable_licenses: ["Android-Apache-2.0"], |
Bob Badour | 390b27e | 2021-03-19 04:22:23 -0700 | [diff] [blame] | 18 | } |
| 19 | |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 20 | // Source code used for test |
Sunny Goyal | f5c42ea | 2021-03-12 16:00:40 -0800 | [diff] [blame] | 21 | filegroup { |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 22 | name: "launcher-tests-src", |
Thales Lima | a101290 | 2022-01-13 17:58:42 +0000 | [diff] [blame] | 23 | srcs: [ |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 24 | "src/**/*.java", |
| 25 | "src/**/*.kt", |
Kevin Lim | a14145a | 2024-03-19 18:56:34 +0000 | [diff] [blame] | 26 | ":launcher3-robo-src", |
Thales Lima | a101290 | 2022-01-13 17:58:42 +0000 | [diff] [blame] | 27 | ], |
Thales Lima | 9938c2f | 2022-07-25 14:38:16 +0100 | [diff] [blame] | 28 | exclude_srcs: [ |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 29 | ":launcher-non-quickstep-tests-src", |
Thales Lima | 9938c2f | 2022-07-25 14:38:16 +0100 | [diff] [blame] | 30 | ], |
| 31 | } |
| 32 | |
Kevin Lim | a14145a | 2024-03-19 18:56:34 +0000 | [diff] [blame] | 33 | filegroup { |
| 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 Lima | 9938c2f | 2022-07-25 14:38:16 +0100 | [diff] [blame] | 43 | // Source code used for non-quickstep tests |
| 44 | filegroup { |
| 45 | name: "launcher-non-quickstep-tests-src", |
| 46 | srcs: [ |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 47 | "src/com/android/launcher3/nonquickstep/**/*.java", |
| 48 | "src/com/android/launcher3/nonquickstep/**/*.kt", |
Thales Lima | 9938c2f | 2022-07-25 14:38:16 +0100 | [diff] [blame] | 49 | ], |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | // Source code used for oop test helpers |
| 53 | filegroup { |
| 54 | name: "launcher-oop-tests-src", |
| 55 | srcs: [ |
Sunny Goyal | 5ca5049 | 2024-03-18 14:50:48 -0700 | [diff] [blame] | 56 | ":launcher-testing-helpers", |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 57 | "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 Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 62 | "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 Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 65 | ], |
| 66 | } |
| 67 | |
| 68 | // Library with all the dependencies for building quickstep |
| 69 | android_library { |
| 70 | name: "Launcher3TestLib", |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 71 | srcs: [], |
Sebastian Franco | e7c3d3d | 2023-01-10 10:47:46 -0600 | [diff] [blame] | 72 | asset_dirs: ["assets"], |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 73 | resource_dirs: ["res"], |
| 74 | static_libs: [ |
Anushree Ganjam | d1a28fe | 2023-08-23 21:40:57 -0700 | [diff] [blame] | 75 | "flag-junit-base", |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 76 | "launcher-aosp-tapl", |
Sunny Goyal | 177785e | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 77 | "androidx.test.core", |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 78 | "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 Isganitis | 06139e0 | 2023-10-03 16:02:39 -0400 | [diff] [blame] | 85 | "mockito-kotlin2", |
Anushree Ganjam | 94efd7a | 2023-08-24 18:28:19 -0700 | [diff] [blame] | 86 | "mockito-target-extended-minus-junit4", |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 87 | "launcher_log_protos_lite", |
Krzysztof KosiĆski | 6e3b7a6 | 2023-10-10 06:50:28 +0000 | [diff] [blame] | 88 | "truth", |
Uwais Ashraf | 6e9927e | 2024-03-25 10:53:06 +0000 | [diff] [blame] | 89 | "kotlinx_coroutines_test", |
vadimt | 13839e4 | 2022-02-17 13:56:06 -0800 | [diff] [blame] | 90 | "platform-test-rules", |
Pat Manning | da69661 | 2023-02-17 15:06:58 +0000 | [diff] [blame] | 91 | "testables", |
Anushree Ganjam | 2a14b97 | 2023-08-30 13:31:10 -0700 | [diff] [blame] | 92 | "com_android_launcher3_flags_lib", |
Jeremy Sim | 9e44e37 | 2023-10-10 14:54:39 -0700 | [diff] [blame] | 93 | "com_android_wm_shell_flags_lib", |
Willie Koomson | fedc18e | 2023-11-07 22:31:46 +0000 | [diff] [blame] | 94 | "android.appwidget.flags-aconfig-java", |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 95 | ], |
| 96 | manifest: "AndroidManifest-common.xml", |
| 97 | platform_apis: true, |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 98 | // TODO(b/319712088): re-enable use_resource_processor |
| 99 | use_resource_processor: false, |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 100 | } |
| 101 | |
My Name | 5b59e75 | 2021-12-15 20:54:45 -0500 | [diff] [blame] | 102 | android_library { |
| 103 | name: "Launcher3TestResources", |
| 104 | resource_dirs: ["res"], |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 105 | // TODO(b/319712088): re-enable use_resource_processor |
| 106 | use_resource_processor: false, |
My Name | 5b59e75 | 2021-12-15 20:54:45 -0500 | [diff] [blame] | 107 | } |
| 108 | |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 109 | android_test { |
| 110 | name: "Launcher3Tests", |
| 111 | srcs: [ |
| 112 | ":launcher-tests-src", |
Thales Lima | 9938c2f | 2022-07-25 14:38:16 +0100 | [diff] [blame] | 113 | ":launcher-non-quickstep-tests-src", |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 114 | ], |
Anushree Ganjam | d1a28fe | 2023-08-23 21:40:57 -0700 | [diff] [blame] | 115 | static_libs: [ |
| 116 | "Launcher3TestLib", |
Anushree Ganjam | 2a14b97 | 2023-08-30 13:31:10 -0700 | [diff] [blame] | 117 | "com_android_launcher3_flags_lib", |
Anushree Ganjam | d1a28fe | 2023-08-23 21:40:57 -0700 | [diff] [blame] | 118 | ], |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 119 | libs: [ |
| 120 | "android.test.base", |
| 121 | "android.test.runner", |
| 122 | "android.test.mock", |
| 123 | ], |
Anushree Ganjam | 94efd7a | 2023-08-24 18:28:19 -0700 | [diff] [blame] | 124 | // Libraries used by mockito inline extended |
Sunny Goyal | 4af8cf9 | 2021-07-29 15:48:24 -0700 | [diff] [blame] | 125 | jni_libs: [ |
| 126 | "libdexmakerjvmtiagent", |
| 127 | "libstaticjvmtiagent", |
| 128 | ], |
| 129 | use_embedded_native_libs: false, |
| 130 | compile_multilib: "both", |
| 131 | instrumentation_for: "Launcher3", |
| 132 | manifest: "AndroidManifest.xml", |
| 133 | platform_apis: true, |
| 134 | test_config: "Launcher3Tests.xml", |
Vadim Tryshev | 990a32e | 2023-03-02 21:51:21 +0000 | [diff] [blame] | 135 | data: [":Launcher3"], |
| 136 | test_suites: ["general-tests"], |
Sunny Goyal | f5c42ea | 2021-03-12 16:00:40 -0800 | [diff] [blame] | 137 | } |
Nicolo' Mazzucato | e8ee34a | 2023-01-24 15:41:10 +0000 | [diff] [blame] | 138 | |
| 139 | // Shared between tests and launcher |
| 140 | android_library { |
| 141 | name: "launcher-testing-shared", |
| 142 | srcs: [ |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 143 | "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.java", |
Uwais Ashraf | f7c9e2c | 2024-02-28 11:47:56 +0000 | [diff] [blame] | 144 | "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.kt", |
Nicolo' Mazzucato | e8ee34a | 2023-01-24 15:41:10 +0000 | [diff] [blame] | 145 | ], |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 146 | resource_dirs: [], |
Uwais Ashraf | 77b97c0 | 2023-12-27 11:44:16 +0000 | [diff] [blame] | 147 | manifest: "multivalentTests/shared/AndroidManifest.xml", |
Nicolo' Mazzucato | e8ee34a | 2023-01-24 15:41:10 +0000 | [diff] [blame] | 148 | sdk_version: "current", |
| 149 | min_sdk_version: min_launcher3_sdk_version, |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 150 | } |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 151 | |
| 152 | filegroup { |
| 153 | name: "launcher-testing-helpers", |
| 154 | srcs: [ |
Colin Cross | f156b6b | 2024-01-11 14:03:12 -0800 | [diff] [blame] | 155 | "src/**/*.java", |
| 156 | "src/**/*.kt", |
| 157 | "multivalentTests/src/**/*.java", |
| 158 | "multivalentTests/src/**/*.kt", |
Uwais Ashraf | 9c2f5a4 | 2024-03-04 09:49:39 +0000 | [diff] [blame] | 159 | "src/com/android/launcher3/ui/AbstractLauncherUiTest.java", |
| 160 | "tapl/com/android/launcher3/tapl/*.java", |
| 161 | "tapl/com/android/launcher3/tapl/*.kt", |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 162 | ], |
| 163 | exclude_srcs: [ |
| 164 | // Test classes |
| 165 | "src/**/*Test.java", |
| 166 | "src/**/*Test.kt", |
Uwais Ashraf | 77b97c0 | 2023-12-27 11:44:16 +0000 | [diff] [blame] | 167 | "multivalentTests/src/**/*Test.java", |
| 168 | "multivalentTests/src/**/*Test.kt", |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 169 | ], |
| 170 | } |
| 171 | |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 172 | android_robolectric_test { |
| 173 | enabled: true, |
| 174 | name: "Launcher3RoboTests", |
| 175 | srcs: [ |
Kevin Lim | a14145a | 2024-03-19 18:56:34 +0000 | [diff] [blame] | 176 | ":launcher3-robo-src", |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 177 | |
| 178 | // Test util classes |
| 179 | ":launcher-testing-helpers", |
| 180 | ":launcher-testing-shared", |
| 181 | ], |
| 182 | exclude_srcs: [ |
Uwais Ashraf | 77b97c0 | 2023-12-27 11:44:16 +0000 | [diff] [blame] | 183 | //"src/com/android/launcher3/util/CellContentDimensionsTest.kt", // Failing - b/316553889 |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 184 | |
| 185 | // requires modification to work with inline mock maker |
| 186 | "src/com/android/launcher3/util/rule/StaticMockitoRule.java", |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 187 | ], |
| 188 | java_resource_dirs: ["config"], |
| 189 | static_libs: [ |
| 190 | "flag-junit-base", |
| 191 | "com_android_launcher3_flags_lib", |
| 192 | "com_android_wm_shell_flags_lib", |
| 193 | "androidx.test.uiautomator_uiautomator", |
| 194 | "androidx.core_core-animation-testing", |
| 195 | "androidx.test.ext.junit", |
Sihua Ma | 444b8e6 | 2024-03-21 21:50:20 +0000 | [diff] [blame] | 196 | "androidx.test.rules", |
Uwais Ashraf | f7c9e2c | 2024-02-28 11:47:56 +0000 | [diff] [blame] | 197 | "mockito-robolectric-prebuilt", |
| 198 | "mockito-kotlin2", |
Uwais Ashraf | 861f2fd | 2023-12-19 10:09:25 +0000 | [diff] [blame] | 199 | "platform-parametric-runner-lib", |
| 200 | "testables", |
| 201 | "Launcher3TestResources", |
| 202 | "SystemUISharedLib", |
| 203 | "launcher-testing-shared", |
| 204 | ], |
| 205 | libs: [ |
| 206 | "android.test.runner", |
| 207 | "android.test.base", |
| 208 | "android.test.mock", |
| 209 | "truth", |
| 210 | ], |
| 211 | instrumentation_for: "Launcher3", |
| 212 | upstream: true, |
| 213 | } |