blob: 9824123c0ed6afa706ca24591870d379008040a4 [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 ],
Remi NGUYEN VAN26b86bb2018-09-28 07:51:13 +000048 }
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",
96 "libvndksupport",
97 "libtinyxml2",
98]
99
100cc_test {
101 name: "recovery_unit_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700102 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700103
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",
Tao Baoef5e38f2018-07-24 15:34:39 -0700121 ],
122
123 data: ["testdata/*"],
124}
125
126cc_test {
127 name: "recovery_manual_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700128 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700129
130 defaults: [
131 "recovery_test_defaults",
132 ],
133
134 test_suites: ["device-tests"],
135
136 srcs: [
137 "manual/recovery_test.cpp",
138 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700139}
140
141cc_test {
142 name: "recovery_component_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700143 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700144
145 defaults: [
146 "recovery_test_defaults",
147 "libupdater_defaults",
148 ],
149
150 test_suites: ["device-tests"],
151
152 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700153 "component/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700154 ],
155
156 static_libs: libapplypatch_static_libs + librecovery_static_libs + [
157 "libupdater",
158 "libupdate_verifier",
159 "libprotobuf-cpp-lite",
Tao Baoef5e38f2018-07-24 15:34:39 -0700160 ],
161
162 data: [
163 "testdata/*",
164 ":res-testdata",
165 ],
166}
167
168cc_test_host {
169 name: "recovery_host_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700170 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700171
172 defaults: [
173 "recovery_test_defaults",
174 ],
175
176 srcs: [
177 "component/imgdiff_test.cpp",
178 ],
179
180 static_libs: [
181 "libimgdiff",
182 "libimgpatch",
183 "libotautil",
184 "libbsdiff",
185 "libbspatch",
186 "libziparchive",
187 "libutils",
188 "libcrypto",
189 "libbrotli",
190 "libbz",
191 "libdivsufsort64",
192 "libdivsufsort",
193 "libz",
Tao Baoef5e38f2018-07-24 15:34:39 -0700194 ],
195
196 data: ["testdata/*"],
Andreas Huber435dfac2018-08-15 16:11:25 -0700197
198 target: {
199 darwin: {
200 // libimgdiff is not available on the Mac.
201 enabled: false,
202 },
203 },
Tao Baoef5e38f2018-07-24 15:34:39 -0700204}