blob: 9f3dce78c07c9e6997b4d3611f65d5d9ebf1a515 [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 ],
Jayant Chowdharya71c10b2018-09-19 18:38:04 -070048 },
Tao Baoef5e38f2018-07-24 15:34:39 -070049 },
50}
51
52// libapplypatch, libapplypatch_modes, libimgdiff, libimgpatch
53libapplypatch_static_libs = [
54 "libapplypatch_modes",
55 "libapplypatch",
56 "libedify",
57 "libimgdiff",
58 "libimgpatch",
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",
68 "libcrypto",
69 "libz",
70 "libziparchive",
71]
72
73// librecovery_defaults uses many shared libs that we want to avoid using in tests (e.g. we don't
74// have 32-bit android.hardware.health@2.0.so or libbootloader_message.so on marlin).
75librecovery_static_libs = [
76 "librecovery",
77 "librecovery_fastboot",
78 "libminui",
79 "libverifier",
80 "libotautil",
81
82 "libhealthhalutils",
83 "libvintf_recovery",
84 "libvintf",
85
86 "android.hardware.health@2.0",
87 "android.hardware.health@1.0",
88 "libbootloader_message",
89 "libext4_utils",
90 "libfs_mgr",
91 "libfusesideload",
92 "libhidl-gen-utils",
93 "libhidlbase",
94 "libhidltransport",
95 "libhwbinder",
Jayant Chowdharya71c10b2018-09-19 18:38:04 -070096 "libbinderthreadstate",
Tao Baoef5e38f2018-07-24 15:34:39 -070097 "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}