blob: e49d966c7c805facafb6a9f09cfd5d0b873b7445 [file] [log] [blame]
Tao Baoef5e38f2018-07-24 15:34:39 -07001// Copyright (C) 2018 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
15cc_defaults {
16 name: "recovery_test_defaults",
17
18 defaults: [
19 "recovery_defaults",
20 ],
21
22 include_dirs: [
23 "bootable/recovery",
24 ],
25
26 shared_libs: [
27 "libbase",
28 "libcrypto",
29 "libcutils",
30 "liblog",
31 "libpng",
Suren Baghdasaryan0ca607c2019-01-25 05:33:42 +000032 "libprocessgroup",
Tao Baoef5e38f2018-07-24 15:34:39 -070033 "libselinux",
34 "libz",
35 "libziparchive",
36 ],
37
38 target: {
39 android: {
40 shared_libs: [
41 "libutils",
Peter Collingbourne8f2f0d02019-12-17 17:51:42 -080042 "libvndksupport",
Tao Baoef5e38f2018-07-24 15:34:39 -070043 ],
44 },
45
46 host: {
47 static_libs: [
48 "libutils",
49 ],
Jayant Chowdharyd24b0542018-10-01 22:55:56 +000050 },
Tao Baoef5e38f2018-07-24 15:34:39 -070051 },
52}
53
Tianjie Xu45c40ec2019-07-02 15:09:24 -070054// libapplypatch, libapplypatch_modes
Tao Baoef5e38f2018-07-24 15:34:39 -070055libapplypatch_static_libs = [
56 "libapplypatch_modes",
57 "libapplypatch",
58 "libedify",
Tao Baoef5e38f2018-07-24 15:34:39 -070059 "libotautil",
60 "libbsdiff",
61 "libbspatch",
62 "libdivsufsort",
63 "libdivsufsort64",
64 "libutils",
65 "libbase",
66 "libbrotli",
67 "libbz",
Tao Baoef5e38f2018-07-24 15:34:39 -070068 "libz",
69 "libziparchive",
70]
71
72// librecovery_defaults uses many shared libs that we want to avoid using in tests (e.g. we don't
73// have 32-bit android.hardware.health@2.0.so or libbootloader_message.so on marlin).
74librecovery_static_libs = [
75 "librecovery",
76 "librecovery_fastboot",
xunchang24788852019-03-22 16:08:52 -070077 "libinstall",
78 "librecovery_ui",
Tao Baoef5e38f2018-07-24 15:34:39 -070079 "libminui",
Tao Bao4a01f362019-04-26 23:41:49 -070080 "libfusesideload",
81 "libbootloader_message",
Tao Baoef5e38f2018-07-24 15:34:39 -070082 "libotautil",
83
84 "libhealthhalutils",
Tao Baoef5e38f2018-07-24 15:34:39 -070085 "libvintf",
86
87 "android.hardware.health@2.0",
88 "android.hardware.health@1.0",
Tao Baoef5e38f2018-07-24 15:34:39 -070089 "libext4_utils",
90 "libfs_mgr",
Tao Baoef5e38f2018-07-24 15:34:39 -070091 "libhidl-gen-utils",
92 "libhidlbase",
Jayant Chowdharyd24b0542018-10-01 22:55:56 +000093 "libbinderthreadstate",
Yifan Hong0f339e22018-12-03 13:44:01 -080094 "liblp",
Tao Baoef5e38f2018-07-24 15:34:39 -070095 "libtinyxml2",
96]
97
98cc_test {
99 name: "recovery_unit_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700100 isolated: true,
Tao Baodfb053e2019-09-19 08:08:54 -0700101 require_root: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700102
103 defaults: [
104 "recovery_test_defaults",
Tao Bao4a01f362019-04-26 23:41:49 -0700105 "libupdater_defaults",
Tianjie Xuc1a5e262019-05-22 14:34:12 -0700106 "libupdater_device_defaults",
Tao Baoef5e38f2018-07-24 15:34:39 -0700107 ],
108
109 test_suites: ["device-tests"],
110
111 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700112 "unit/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700113 ],
114
Tao Bao4a01f362019-04-26 23:41:49 -0700115 static_libs: libapplypatch_static_libs + librecovery_static_libs + [
Tao Baoef5e38f2018-07-24 15:34:39 -0700116 "librecovery_ui",
xunchang311e6ca2019-03-22 08:54:35 -0700117 "libfusesideload",
Tao Baoef5e38f2018-07-24 15:34:39 -0700118 "libminui",
Tao Baoe3f09a72019-10-01 11:55:36 -0700119 "librecovery_utils",
Tao Baoef5e38f2018-07-24 15:34:39 -0700120 "libotautil",
Tianjie Xuc1a5e262019-05-22 14:34:12 -0700121 "libupdater_device",
122 "libupdater_core",
Tao Bao4a01f362019-04-26 23:41:49 -0700123 "libupdate_verifier",
124
Tao Baoef5e38f2018-07-24 15:34:39 -0700125 "libgtest_prod",
Tao Bao4a01f362019-04-26 23:41:49 -0700126 "libprotobuf-cpp-lite",
Tao Baoef5e38f2018-07-24 15:34:39 -0700127 ],
128
Tao Bao4a01f362019-04-26 23:41:49 -0700129 data: [
130 "testdata/*",
131 ":res-testdata",
132 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700133}
134
135cc_test {
136 name: "recovery_manual_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700137 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700138
139 defaults: [
140 "recovery_test_defaults",
141 ],
142
143 test_suites: ["device-tests"],
144
145 srcs: [
146 "manual/recovery_test.cpp",
147 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700148}
149
Tao Baoef5e38f2018-07-24 15:34:39 -0700150cc_test_host {
151 name: "recovery_host_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700152 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700153
154 defaults: [
155 "recovery_test_defaults",
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700156 "libupdater_defaults",
Tao Baoef5e38f2018-07-24 15:34:39 -0700157 ],
158
159 srcs: [
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700160 "unit/host/*",
Tao Baoef5e38f2018-07-24 15:34:39 -0700161 ],
162
163 static_libs: [
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700164 "libupdater_host",
165 "libupdater_core",
Tao Baoef5e38f2018-07-24 15:34:39 -0700166 "libimgdiff",
Tao Baoef5e38f2018-07-24 15:34:39 -0700167 "libbsdiff",
Tao Baoef5e38f2018-07-24 15:34:39 -0700168 "libdivsufsort64",
169 "libdivsufsort",
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700170 "libfstab",
171 "libc++fs",
Tao Baoef5e38f2018-07-24 15:34:39 -0700172 ],
173
Tao Bao83186dd2019-04-24 21:34:17 -0700174 test_suites: ["general-tests"],
175
Tao Baoef5e38f2018-07-24 15:34:39 -0700176 data: ["testdata/*"],
Andreas Huber435dfac2018-08-15 16:11:25 -0700177
178 target: {
179 darwin: {
Tianjie Xu45c40ec2019-07-02 15:09:24 -0700180 // libapplypatch in "libupdater_defaults" is not available on the Mac.
Andreas Huber435dfac2018-08-15 16:11:25 -0700181 enabled: false,
182 },
183 },
Tao Baoef5e38f2018-07-24 15:34:39 -0700184}