blob: 898ed7d60ac1e103ec7d5fc84d9d3fff7d836f5e [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 Baghdasaryan62d0c782019-01-13 12:48:24 -080032 "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",
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",
Pirama Arumuga Nainarb3339dd2018-11-14 11:39:24 -080096 "libhwbinder_noltopgo",
Jayant Chowdharyd24b0542018-10-01 22:55:56 +000097 "libbinderthreadstate",
Yifan Hong0f339e22018-12-03 13:44:01 -080098 "liblp",
Tao Baoef5e38f2018-07-24 15:34:39 -070099 "libvndksupport",
100 "libtinyxml2",
101]
102
103cc_test {
104 name: "recovery_unit_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700105 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700106
107 defaults: [
108 "recovery_test_defaults",
109 ],
110
111 test_suites: ["device-tests"],
112
113 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700114 "unit/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700115 ],
116
117 static_libs: libapplypatch_static_libs + [
118 "librecovery_ui",
119 "libminui",
120 "libverifier",
121 "libotautil",
122 "libupdater",
123 "libgtest_prod",
Tao Baoef5e38f2018-07-24 15:34:39 -0700124 ],
125
126 data: ["testdata/*"],
127}
128
129cc_test {
130 name: "recovery_manual_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700131 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700132
133 defaults: [
134 "recovery_test_defaults",
135 ],
136
137 test_suites: ["device-tests"],
138
139 srcs: [
140 "manual/recovery_test.cpp",
141 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700142}
143
144cc_test {
145 name: "recovery_component_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700146 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700147
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",
Tao Baoef5e38f2018-07-24 15:34:39 -0700163 ],
164
165 data: [
166 "testdata/*",
167 ":res-testdata",
168 ],
169}
170
171cc_test_host {
172 name: "recovery_host_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700173 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700174
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",
Tao Baoef5e38f2018-07-24 15:34:39 -0700197 ],
198
199 data: ["testdata/*"],
Andreas Huber435dfac2018-08-15 16:11:25 -0700200
201 target: {
202 darwin: {
203 // libimgdiff is not available on the Mac.
204 enabled: false,
205 },
206 },
Tao Baoef5e38f2018-07-24 15:34:39 -0700207}