blob: ef5919eb50f630c586c08c098c1983cab4faf371 [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",
42 ],
43 },
44
45 host: {
46 static_libs: [
47 "libutils",
48 ],
Jayant Chowdharyd24b0542018-10-01 22:55:56 +000049 },
Tao Baoef5e38f2018-07-24 15:34:39 -070050 },
51}
52
53// libapplypatch, libapplypatch_modes, libimgdiff, libimgpatch
54libapplypatch_static_libs = [
55 "libapplypatch_modes",
56 "libapplypatch",
57 "libedify",
58 "libimgdiff",
59 "libimgpatch",
Tao Baoef5e38f2018-07-24 15:34:39 -070060 "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",
xunchang37304f32019-03-12 12:40:14 -070080 "libpackage",
Tao Baoef5e38f2018-07-24 15:34:39 -070081 "libverifier",
82 "libotautil",
83
84 "libhealthhalutils",
85 "libvintf_recovery",
86 "libvintf",
87
88 "android.hardware.health@2.0",
89 "android.hardware.health@1.0",
90 "libbootloader_message",
91 "libext4_utils",
92 "libfs_mgr",
93 "libfusesideload",
94 "libhidl-gen-utils",
95 "libhidlbase",
96 "libhidltransport",
Pirama Arumuga Nainarb3339dd2018-11-14 11:39:24 -080097 "libhwbinder_noltopgo",
Jayant Chowdharyd24b0542018-10-01 22:55:56 +000098 "libbinderthreadstate",
Yifan Hong0f339e22018-12-03 13:44:01 -080099 "liblp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700100 "libvndksupport",
101 "libtinyxml2",
102]
103
104cc_test {
105 name: "recovery_unit_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700106 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700107
108 defaults: [
109 "recovery_test_defaults",
110 ],
111
112 test_suites: ["device-tests"],
113
114 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700115 "unit/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700116 ],
117
118 static_libs: libapplypatch_static_libs + [
119 "librecovery_ui",
120 "libminui",
xunchang37304f32019-03-12 12:40:14 -0700121 "libpackage",
Tao Baoef5e38f2018-07-24 15:34:39 -0700122 "libverifier",
123 "libotautil",
124 "libupdater",
125 "libgtest_prod",
Tao Baoef5e38f2018-07-24 15:34:39 -0700126 ],
127
128 data: ["testdata/*"],
129}
130
131cc_test {
132 name: "recovery_manual_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700133 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700134
135 defaults: [
136 "recovery_test_defaults",
137 ],
138
139 test_suites: ["device-tests"],
140
141 srcs: [
142 "manual/recovery_test.cpp",
143 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700144}
145
146cc_test {
147 name: "recovery_component_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700148 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700149
150 defaults: [
151 "recovery_test_defaults",
152 "libupdater_defaults",
153 ],
154
155 test_suites: ["device-tests"],
156
157 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700158 "component/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700159 ],
160
161 static_libs: libapplypatch_static_libs + librecovery_static_libs + [
162 "libupdater",
163 "libupdate_verifier",
164 "libprotobuf-cpp-lite",
Tao Baoef5e38f2018-07-24 15:34:39 -0700165 ],
166
167 data: [
168 "testdata/*",
169 ":res-testdata",
170 ],
171}
172
173cc_test_host {
174 name: "recovery_host_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700175 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700176
177 defaults: [
178 "recovery_test_defaults",
179 ],
180
181 srcs: [
182 "component/imgdiff_test.cpp",
183 ],
184
185 static_libs: [
186 "libimgdiff",
187 "libimgpatch",
188 "libotautil",
189 "libbsdiff",
190 "libbspatch",
191 "libziparchive",
192 "libutils",
193 "libcrypto",
194 "libbrotli",
195 "libbz",
196 "libdivsufsort64",
197 "libdivsufsort",
198 "libz",
Tao Baoef5e38f2018-07-24 15:34:39 -0700199 ],
200
201 data: ["testdata/*"],
Andreas Huber435dfac2018-08-15 16:11:25 -0700202
203 target: {
204 darwin: {
205 // libimgdiff is not available on the Mac.
206 enabled: false,
207 },
208 },
Tao Baoef5e38f2018-07-24 15:34:39 -0700209}