blob: d305e25601853e6a06bc7e15b2c05a18d9e4fae7 [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",
32 "libselinux",
33 "libz",
34 "libziparchive",
35 ],
36
37 target: {
38 android: {
39 shared_libs: [
40 "libutils",
41 ],
42 },
43
44 host: {
45 static_libs: [
46 "libutils",
47 ],
48 }
49 },
50}
51
52// libapplypatch, libapplypatch_modes, libimgdiff, libimgpatch
53libapplypatch_static_libs = [
54 "libapplypatch_modes",
55 "libapplypatch",
56 "libedify",
57 "libimgdiff",
58 "libimgpatch",
59 "libotafault",
60 "libotautil",
61 "libbsdiff",
62 "libbspatch",
63 "libdivsufsort",
64 "libdivsufsort64",
65 "libutils",
66 "libbase",
67 "libbrotli",
68 "libbz",
69 "libcrypto",
70 "libz",
71 "libziparchive",
72]
73
74// librecovery_defaults uses many shared libs that we want to avoid using in tests (e.g. we don't
75// have 32-bit android.hardware.health@2.0.so or libbootloader_message.so on marlin).
76librecovery_static_libs = [
77 "librecovery",
78 "librecovery_fastboot",
79 "libminui",
80 "libverifier",
81 "libotautil",
82
83 "libhealthhalutils",
84 "libvintf_recovery",
85 "libvintf",
86
87 "android.hardware.health@2.0",
88 "android.hardware.health@1.0",
89 "libbootloader_message",
90 "libext4_utils",
91 "libfs_mgr",
92 "libfusesideload",
93 "libhidl-gen-utils",
94 "libhidlbase",
95 "libhidltransport",
96 "libhwbinder",
97 "libvndksupport",
98 "libtinyxml2",
99]
100
101cc_test {
102 name: "recovery_unit_test",
103
104 defaults: [
105 "recovery_test_defaults",
106 ],
107
108 test_suites: ["device-tests"],
109
110 srcs: [
111 "unit/asn1_decoder_test.cpp",
112 "unit/applypatch_test.cpp",
113 "unit/commands_test.cpp",
114 "unit/dirutil_test.cpp",
115 "unit/locale_test.cpp",
116 "unit/rangeset_test.cpp",
117 "unit/screen_ui_test.cpp",
118 "unit/sysutil_test.cpp",
119 "unit/zip_test.cpp",
120 ],
121
122 static_libs: libapplypatch_static_libs + [
123 "librecovery_ui",
124 "libminui",
125 "libverifier",
126 "libotautil",
127 "libupdater",
128 "libgtest_prod",
129 "libBionicGtestMain",
130 ],
131
132 data: ["testdata/*"],
133}
134
135cc_test {
136 name: "recovery_manual_test",
137
138 defaults: [
139 "recovery_test_defaults",
140 ],
141
142 test_suites: ["device-tests"],
143
144 srcs: [
145 "manual/recovery_test.cpp",
146 ],
147
148 static_libs: [
149 "libBionicGtestMain",
150 ],
151}
152
153cc_test {
154 name: "recovery_component_test",
155
156 defaults: [
157 "recovery_test_defaults",
158 "libupdater_defaults",
159 ],
160
161 test_suites: ["device-tests"],
162
163 srcs: [
164 "component/bootloader_message_test.cpp",
165 "component/edify_test.cpp",
166 "component/imgdiff_test.cpp",
167 "component/install_test.cpp",
168 "component/resources_test.cpp",
169 "component/sideload_test.cpp",
170 "component/uncrypt_test.cpp",
171 "component/updater_test.cpp",
172 "component/update_verifier_test.cpp",
173 "component/verifier_test.cpp",
174 ],
175
176 static_libs: libapplypatch_static_libs + librecovery_static_libs + [
177 "libupdater",
178 "libupdate_verifier",
179 "libprotobuf-cpp-lite",
180 "libBionicGtestMain",
181 ],
182
183 data: [
184 "testdata/*",
185 ":res-testdata",
186 ],
187}
188
189cc_test_host {
190 name: "recovery_host_test",
191
192 defaults: [
193 "recovery_test_defaults",
194 ],
195
196 srcs: [
197 "component/imgdiff_test.cpp",
198 ],
199
200 static_libs: [
201 "libimgdiff",
202 "libimgpatch",
203 "libotautil",
204 "libbsdiff",
205 "libbspatch",
206 "libziparchive",
207 "libutils",
208 "libcrypto",
209 "libbrotli",
210 "libbz",
211 "libdivsufsort64",
212 "libdivsufsort",
213 "libz",
214 "libBionicGtestMain",
215 ],
216
217 data: ["testdata/*"],
218}