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 | ], |
Remi NGUYEN VAN | 26b86bb | 2018-09-28 07:51:13 +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", |
| 95 | "libhwbinder", |
| 96 | "libvndksupport", |
| 97 | "libtinyxml2", |
| 98 | ] |
| 99 | |
| 100 | cc_test { |
| 101 | name: "recovery_unit_test", |
| 102 | |
| 103 | defaults: [ |
| 104 | "recovery_test_defaults", |
| 105 | ], |
| 106 | |
| 107 | test_suites: ["device-tests"], |
| 108 | |
| 109 | srcs: [ |
Tao Bao | 26b6454 | 2018-08-15 15:18:48 -0700 | [diff] [blame] | 110 | "unit/*.cpp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 111 | ], |
| 112 | |
| 113 | static_libs: libapplypatch_static_libs + [ |
| 114 | "librecovery_ui", |
| 115 | "libminui", |
| 116 | "libverifier", |
| 117 | "libotautil", |
| 118 | "libupdater", |
| 119 | "libgtest_prod", |
| 120 | "libBionicGtestMain", |
| 121 | ], |
| 122 | |
| 123 | data: ["testdata/*"], |
| 124 | } |
| 125 | |
| 126 | cc_test { |
| 127 | name: "recovery_manual_test", |
| 128 | |
| 129 | defaults: [ |
| 130 | "recovery_test_defaults", |
| 131 | ], |
| 132 | |
| 133 | test_suites: ["device-tests"], |
| 134 | |
| 135 | srcs: [ |
| 136 | "manual/recovery_test.cpp", |
| 137 | ], |
| 138 | |
| 139 | static_libs: [ |
| 140 | "libBionicGtestMain", |
| 141 | ], |
| 142 | } |
| 143 | |
| 144 | cc_test { |
| 145 | name: "recovery_component_test", |
| 146 | |
| 147 | defaults: [ |
| 148 | "recovery_test_defaults", |
| 149 | "libupdater_defaults", |
| 150 | ], |
| 151 | |
| 152 | test_suites: ["device-tests"], |
| 153 | |
| 154 | srcs: [ |
Tao Bao | 26b6454 | 2018-08-15 15:18:48 -0700 | [diff] [blame] | 155 | "component/*.cpp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 156 | ], |
| 157 | |
| 158 | static_libs: libapplypatch_static_libs + librecovery_static_libs + [ |
| 159 | "libupdater", |
| 160 | "libupdate_verifier", |
| 161 | "libprotobuf-cpp-lite", |
| 162 | "libBionicGtestMain", |
| 163 | ], |
| 164 | |
| 165 | data: [ |
| 166 | "testdata/*", |
| 167 | ":res-testdata", |
| 168 | ], |
| 169 | } |
| 170 | |
| 171 | cc_test_host { |
| 172 | name: "recovery_host_test", |
| 173 | |
| 174 | defaults: [ |
| 175 | "recovery_test_defaults", |
| 176 | ], |
| 177 | |
| 178 | srcs: [ |
| 179 | "component/imgdiff_test.cpp", |
| 180 | ], |
| 181 | |
| 182 | static_libs: [ |
| 183 | "libimgdiff", |
| 184 | "libimgpatch", |
| 185 | "libotautil", |
| 186 | "libbsdiff", |
| 187 | "libbspatch", |
| 188 | "libziparchive", |
| 189 | "libutils", |
| 190 | "libcrypto", |
| 191 | "libbrotli", |
| 192 | "libbz", |
| 193 | "libdivsufsort64", |
| 194 | "libdivsufsort", |
| 195 | "libz", |
| 196 | "libBionicGtestMain", |
| 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 | } |