blob: dc20f3326a899e8d014a255f20d4ce46c9412934 [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: [
Tao Bao26b64542018-08-15 15:18:48 -0700111 "unit/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700112 ],
113
114 static_libs: libapplypatch_static_libs + [
115 "librecovery_ui",
116 "libminui",
117 "libverifier",
118 "libotautil",
119 "libupdater",
120 "libgtest_prod",
121 "libBionicGtestMain",
122 ],
123
124 data: ["testdata/*"],
125}
126
127cc_test {
128 name: "recovery_manual_test",
129
130 defaults: [
131 "recovery_test_defaults",
132 ],
133
134 test_suites: ["device-tests"],
135
136 srcs: [
137 "manual/recovery_test.cpp",
138 ],
139
140 static_libs: [
141 "libBionicGtestMain",
142 ],
143}
144
145cc_test {
146 name: "recovery_component_test",
147
148 defaults: [
149 "recovery_test_defaults",
150 "libupdater_defaults",
151 ],
152
153 test_suites: ["device-tests"],
154
155 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700156 "component/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700157 ],
158
159 static_libs: libapplypatch_static_libs + librecovery_static_libs + [
160 "libupdater",
161 "libupdate_verifier",
162 "libprotobuf-cpp-lite",
163 "libBionicGtestMain",
164 ],
165
166 data: [
167 "testdata/*",
168 ":res-testdata",
169 ],
170}
171
172cc_test_host {
173 name: "recovery_host_test",
174
175 defaults: [
176 "recovery_test_defaults",
177 ],
178
179 srcs: [
180 "component/imgdiff_test.cpp",
181 ],
182
183 static_libs: [
184 "libimgdiff",
185 "libimgpatch",
186 "libotautil",
187 "libbsdiff",
188 "libbspatch",
189 "libziparchive",
190 "libutils",
191 "libcrypto",
192 "libbrotli",
193 "libbz",
194 "libdivsufsort64",
195 "libdivsufsort",
196 "libz",
197 "libBionicGtestMain",
198 ],
199
200 data: ["testdata/*"],
Andreas Huber435dfac2018-08-15 16:11:25 -0700201
202 target: {
203 darwin: {
204 // libimgdiff is not available on the Mac.
205 enabled: false,
206 },
207 },
Tao Baoef5e38f2018-07-24 15:34:39 -0700208}