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