blob: 1801f3b5f91b81901257a55a6e55a713e546bd93 [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
Tianjie Xu42d77792019-06-28 11:04:07 -070053// libapplypatch, libapplypatch_modes, libimgpatch
Tao Baoef5e38f2018-07-24 15:34:39 -070054libapplypatch_static_libs = [
55 "libapplypatch_modes",
56 "libapplypatch",
57 "libedify",
Tao Baoef5e38f2018-07-24 15:34:39 -070058 "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",
xunchang24788852019-03-22 16:08:52 -070078 "libinstall",
79 "librecovery_ui",
Tao Baoef5e38f2018-07-24 15:34:39 -070080 "libminui",
Tao Bao4a01f362019-04-26 23:41:49 -070081 "libfusesideload",
82 "libbootloader_message",
Tao Baoef5e38f2018-07-24 15:34:39 -070083 "libotautil",
84
85 "libhealthhalutils",
86 "libvintf_recovery",
87 "libvintf",
88
89 "android.hardware.health@2.0",
90 "android.hardware.health@1.0",
Tao Baoef5e38f2018-07-24 15:34:39 -070091 "libext4_utils",
92 "libfs_mgr",
Tao Baoef5e38f2018-07-24 15:34:39 -070093 "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",
Tao Bao4a01f362019-04-26 23:41:49 -0700109 "libupdater_defaults",
Tianjie Xuc1a5e262019-05-22 14:34:12 -0700110 "libupdater_device_defaults",
Tao Baoef5e38f2018-07-24 15:34:39 -0700111 ],
112
113 test_suites: ["device-tests"],
114
115 srcs: [
Tao Bao26b64542018-08-15 15:18:48 -0700116 "unit/*.cpp",
Tao Baoef5e38f2018-07-24 15:34:39 -0700117 ],
118
Tao Bao4a01f362019-04-26 23:41:49 -0700119 static_libs: libapplypatch_static_libs + librecovery_static_libs + [
Tao Baoef5e38f2018-07-24 15:34:39 -0700120 "librecovery_ui",
xunchang311e6ca2019-03-22 08:54:35 -0700121 "libfusesideload",
Tao Baoef5e38f2018-07-24 15:34:39 -0700122 "libminui",
Tao Baoef5e38f2018-07-24 15:34:39 -0700123 "libotautil",
Tianjie Xuc1a5e262019-05-22 14:34:12 -0700124 "libupdater_device",
125 "libupdater_core",
Tao Bao4a01f362019-04-26 23:41:49 -0700126 "libupdate_verifier",
127
Tao Baoef5e38f2018-07-24 15:34:39 -0700128 "libgtest_prod",
Tao Bao4a01f362019-04-26 23:41:49 -0700129 "libprotobuf-cpp-lite",
Tao Baoef5e38f2018-07-24 15:34:39 -0700130 ],
131
Tao Bao4a01f362019-04-26 23:41:49 -0700132 data: [
133 "testdata/*",
134 ":res-testdata",
135 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700136}
137
138cc_test {
139 name: "recovery_manual_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700140 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700141
142 defaults: [
143 "recovery_test_defaults",
144 ],
145
146 test_suites: ["device-tests"],
147
148 srcs: [
149 "manual/recovery_test.cpp",
150 ],
Tao Baoef5e38f2018-07-24 15:34:39 -0700151}
152
Tao Baoef5e38f2018-07-24 15:34:39 -0700153cc_test_host {
154 name: "recovery_host_test",
Christopher Ferris272467d2018-08-22 19:38:49 -0700155 isolated: true,
Tao Baoef5e38f2018-07-24 15:34:39 -0700156
157 defaults: [
158 "recovery_test_defaults",
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700159 "libupdater_defaults",
Tao Baoef5e38f2018-07-24 15:34:39 -0700160 ],
161
162 srcs: [
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700163 "unit/host/*",
Tao Baoef5e38f2018-07-24 15:34:39 -0700164 ],
165
166 static_libs: [
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700167 "libupdater_host",
168 "libupdater_core",
Tao Baoef5e38f2018-07-24 15:34:39 -0700169 "libimgdiff",
Tao Baoef5e38f2018-07-24 15:34:39 -0700170 "libbsdiff",
Tao Baoef5e38f2018-07-24 15:34:39 -0700171 "libdivsufsort64",
172 "libdivsufsort",
Tianjie Xuc3a161e2019-06-20 18:16:49 -0700173 "libfstab",
174 "libc++fs",
Tao Baoef5e38f2018-07-24 15:34:39 -0700175 ],
176
Tao Bao83186dd2019-04-24 21:34:17 -0700177 test_suites: ["general-tests"],
178
Tao Baoef5e38f2018-07-24 15:34:39 -0700179 data: ["testdata/*"],
Andreas Huber435dfac2018-08-15 16:11:25 -0700180
181 target: {
182 darwin: {
183 // libimgdiff is not available on the Mac.
184 enabled: false,
185 },
186 },
Tao Baoef5e38f2018-07-24 15:34:39 -0700187}