Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | cc_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 Baghdasaryan | 0ca607c | 2019-01-25 05:33:42 +0000 | [diff] [blame] | 32 | "libprocessgroup", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 33 | "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 Chowdhary | d24b054 | 2018-10-01 22:55:56 +0000 | [diff] [blame] | 49 | }, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 50 | }, |
| 51 | } |
| 52 | |
| 53 | // libapplypatch, libapplypatch_modes, libimgdiff, libimgpatch |
| 54 | libapplypatch_static_libs = [ |
| 55 | "libapplypatch_modes", |
| 56 | "libapplypatch", |
| 57 | "libedify", |
| 58 | "libimgdiff", |
| 59 | "libimgpatch", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 60 | "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). |
| 76 | librecovery_static_libs = [ |
| 77 | "librecovery", |
| 78 | "librecovery_fastboot", |
xunchang | 2478885 | 2019-03-22 16:08:52 -0700 | [diff] [blame] | 79 | "libinstall", |
| 80 | "librecovery_ui", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 81 | "libminui", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 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 Nainar | b3339dd | 2018-11-14 11:39:24 -0800 | [diff] [blame] | 97 | "libhwbinder_noltopgo", |
Jayant Chowdhary | d24b054 | 2018-10-01 22:55:56 +0000 | [diff] [blame] | 98 | "libbinderthreadstate", |
Yifan Hong | 0f339e2 | 2018-12-03 13:44:01 -0800 | [diff] [blame] | 99 | "liblp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 100 | "libvndksupport", |
| 101 | "libtinyxml2", |
| 102 | ] |
| 103 | |
| 104 | cc_test { |
| 105 | name: "recovery_unit_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 106 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 107 | |
| 108 | defaults: [ |
| 109 | "recovery_test_defaults", |
| 110 | ], |
| 111 | |
| 112 | test_suites: ["device-tests"], |
| 113 | |
| 114 | srcs: [ |
Tao Bao | 26b6454 | 2018-08-15 15:18:48 -0700 | [diff] [blame] | 115 | "unit/*.cpp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 116 | ], |
| 117 | |
| 118 | static_libs: libapplypatch_static_libs + [ |
xunchang | 2478885 | 2019-03-22 16:08:52 -0700 | [diff] [blame] | 119 | "libinstall", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 120 | "librecovery_ui", |
| 121 | "libminui", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 122 | "libotautil", |
| 123 | "libupdater", |
| 124 | "libgtest_prod", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 125 | ], |
| 126 | |
| 127 | data: ["testdata/*"], |
| 128 | } |
| 129 | |
| 130 | cc_test { |
| 131 | name: "recovery_manual_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 132 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 133 | |
| 134 | defaults: [ |
| 135 | "recovery_test_defaults", |
| 136 | ], |
| 137 | |
| 138 | test_suites: ["device-tests"], |
| 139 | |
| 140 | srcs: [ |
| 141 | "manual/recovery_test.cpp", |
| 142 | ], |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | cc_test { |
| 146 | name: "recovery_component_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 147 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 148 | |
| 149 | defaults: [ |
| 150 | "recovery_test_defaults", |
| 151 | "libupdater_defaults", |
| 152 | ], |
| 153 | |
| 154 | test_suites: ["device-tests"], |
| 155 | |
| 156 | srcs: [ |
Tao Bao | 26b6454 | 2018-08-15 15:18:48 -0700 | [diff] [blame] | 157 | "component/*.cpp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 158 | ], |
| 159 | |
| 160 | static_libs: libapplypatch_static_libs + librecovery_static_libs + [ |
| 161 | "libupdater", |
| 162 | "libupdate_verifier", |
| 163 | "libprotobuf-cpp-lite", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 164 | ], |
| 165 | |
| 166 | data: [ |
| 167 | "testdata/*", |
| 168 | ":res-testdata", |
| 169 | ], |
| 170 | } |
| 171 | |
| 172 | cc_test_host { |
| 173 | name: "recovery_host_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 174 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 175 | |
| 176 | defaults: [ |
| 177 | "recovery_test_defaults", |
| 178 | ], |
| 179 | |
| 180 | srcs: [ |
| 181 | "component/imgdiff_test.cpp", |
| 182 | ], |
| 183 | |
| 184 | static_libs: [ |
| 185 | "libimgdiff", |
| 186 | "libimgpatch", |
| 187 | "libotautil", |
| 188 | "libbsdiff", |
| 189 | "libbspatch", |
| 190 | "libziparchive", |
| 191 | "libutils", |
| 192 | "libcrypto", |
| 193 | "libbrotli", |
| 194 | "libbz", |
| 195 | "libdivsufsort64", |
| 196 | "libdivsufsort", |
| 197 | "libz", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 198 | ], |
| 199 | |
Tao Bao | 83186dd | 2019-04-24 21:34:17 -0700 | [diff] [blame] | 200 | test_suites: ["general-tests"], |
| 201 | |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 202 | data: ["testdata/*"], |
Andreas Huber | 435dfac | 2018-08-15 16:11:25 -0700 | [diff] [blame] | 203 | |
| 204 | target: { |
| 205 | darwin: { |
| 206 | // libimgdiff is not available on the Mac. |
| 207 | enabled: false, |
| 208 | }, |
| 209 | }, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 210 | } |