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 | 62d0c78 | 2019-01-13 12:48:24 -0800 | [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", |
| 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 Nainar | b3339dd | 2018-11-14 11:39:24 -0800 | [diff] [blame] | 96 | "libhwbinder_noltopgo", |
Jayant Chowdhary | d24b054 | 2018-10-01 22:55:56 +0000 | [diff] [blame] | 97 | "libbinderthreadstate", |
Yifan Hong | 0f339e2 | 2018-12-03 13:44:01 -0800 | [diff] [blame] | 98 | "liblp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 99 | "libvndksupport", |
| 100 | "libtinyxml2", |
| 101 | ] |
| 102 | |
| 103 | cc_test { |
| 104 | name: "recovery_unit_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 105 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 106 | |
| 107 | defaults: [ |
| 108 | "recovery_test_defaults", |
| 109 | ], |
| 110 | |
| 111 | test_suites: ["device-tests"], |
| 112 | |
| 113 | srcs: [ |
Tao Bao | 26b6454 | 2018-08-15 15:18:48 -0700 | [diff] [blame] | 114 | "unit/*.cpp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 115 | ], |
| 116 | |
| 117 | static_libs: libapplypatch_static_libs + [ |
| 118 | "librecovery_ui", |
| 119 | "libminui", |
| 120 | "libverifier", |
| 121 | "libotautil", |
| 122 | "libupdater", |
| 123 | "libgtest_prod", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 124 | ], |
| 125 | |
| 126 | data: ["testdata/*"], |
| 127 | } |
| 128 | |
| 129 | cc_test { |
| 130 | name: "recovery_manual_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 131 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 132 | |
| 133 | defaults: [ |
| 134 | "recovery_test_defaults", |
| 135 | ], |
| 136 | |
| 137 | test_suites: ["device-tests"], |
| 138 | |
| 139 | srcs: [ |
| 140 | "manual/recovery_test.cpp", |
| 141 | ], |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | cc_test { |
| 145 | name: "recovery_component_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 146 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 147 | |
| 148 | defaults: [ |
| 149 | "recovery_test_defaults", |
| 150 | "libupdater_defaults", |
| 151 | ], |
| 152 | |
| 153 | test_suites: ["device-tests"], |
| 154 | |
| 155 | srcs: [ |
Tao Bao | 26b6454 | 2018-08-15 15:18:48 -0700 | [diff] [blame] | 156 | "component/*.cpp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 157 | ], |
| 158 | |
| 159 | static_libs: libapplypatch_static_libs + librecovery_static_libs + [ |
| 160 | "libupdater", |
| 161 | "libupdate_verifier", |
| 162 | "libprotobuf-cpp-lite", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 163 | ], |
| 164 | |
| 165 | data: [ |
| 166 | "testdata/*", |
| 167 | ":res-testdata", |
| 168 | ], |
| 169 | } |
| 170 | |
| 171 | cc_test_host { |
| 172 | name: "recovery_host_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 173 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 174 | |
| 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 Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 197 | ], |
| 198 | |
| 199 | data: ["testdata/*"], |
Andreas Huber | 435dfac | 2018-08-15 16:11:25 -0700 | [diff] [blame] | 200 | |
| 201 | target: { |
| 202 | darwin: { |
| 203 | // libimgdiff is not available on the Mac. |
| 204 | enabled: false, |
| 205 | }, |
| 206 | }, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 207 | } |