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 | |
Tianjie Xu | 45c40ec | 2019-07-02 15:09:24 -0700 | [diff] [blame] | 53 | // libapplypatch, libapplypatch_modes |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 54 | libapplypatch_static_libs = [ |
| 55 | "libapplypatch_modes", |
| 56 | "libapplypatch", |
| 57 | "libedify", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 58 | "libotautil", |
| 59 | "libbsdiff", |
| 60 | "libbspatch", |
| 61 | "libdivsufsort", |
| 62 | "libdivsufsort64", |
| 63 | "libutils", |
| 64 | "libbase", |
| 65 | "libbrotli", |
| 66 | "libbz", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 67 | "libz", |
| 68 | "libziparchive", |
| 69 | ] |
| 70 | |
| 71 | // librecovery_defaults uses many shared libs that we want to avoid using in tests (e.g. we don't |
| 72 | // have 32-bit android.hardware.health@2.0.so or libbootloader_message.so on marlin). |
| 73 | librecovery_static_libs = [ |
| 74 | "librecovery", |
| 75 | "librecovery_fastboot", |
xunchang | 2478885 | 2019-03-22 16:08:52 -0700 | [diff] [blame] | 76 | "libinstall", |
| 77 | "librecovery_ui", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 78 | "libminui", |
Tao Bao | 4a01f36 | 2019-04-26 23:41:49 -0700 | [diff] [blame] | 79 | "libfusesideload", |
| 80 | "libbootloader_message", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 81 | "libotautil", |
| 82 | |
| 83 | "libhealthhalutils", |
| 84 | "libvintf_recovery", |
| 85 | "libvintf", |
| 86 | |
| 87 | "android.hardware.health@2.0", |
| 88 | "android.hardware.health@1.0", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 89 | "libext4_utils", |
| 90 | "libfs_mgr", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 91 | "libhidl-gen-utils", |
| 92 | "libhidlbase", |
Jayant Chowdhary | d24b054 | 2018-10-01 22:55:56 +0000 | [diff] [blame] | 93 | "libbinderthreadstate", |
Yifan Hong | 0f339e2 | 2018-12-03 13:44:01 -0800 | [diff] [blame] | 94 | "liblp", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 95 | "libvndksupport", |
| 96 | "libtinyxml2", |
Tianjie Xu | 58a2769 | 2019-08-06 12:32:05 -0700 | [diff] [blame] | 97 | "libc++fs", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 98 | ] |
| 99 | |
| 100 | cc_test { |
| 101 | name: "recovery_unit_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 102 | isolated: true, |
Tao Bao | dfb053e | 2019-09-19 08:08:54 -0700 | [diff] [blame] | 103 | require_root: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 104 | |
| 105 | defaults: [ |
| 106 | "recovery_test_defaults", |
Tao Bao | 4a01f36 | 2019-04-26 23:41:49 -0700 | [diff] [blame] | 107 | "libupdater_defaults", |
Tianjie Xu | c1a5e26 | 2019-05-22 14:34:12 -0700 | [diff] [blame] | 108 | "libupdater_device_defaults", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 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 | |
Tao Bao | 4a01f36 | 2019-04-26 23:41:49 -0700 | [diff] [blame] | 117 | static_libs: libapplypatch_static_libs + librecovery_static_libs + [ |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 118 | "librecovery_ui", |
xunchang | 311e6ca | 2019-03-22 08:54:35 -0700 | [diff] [blame] | 119 | "libfusesideload", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 120 | "libminui", |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 121 | "librecovery_utils", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 122 | "libotautil", |
Tianjie Xu | c1a5e26 | 2019-05-22 14:34:12 -0700 | [diff] [blame] | 123 | "libupdater_device", |
| 124 | "libupdater_core", |
Tao Bao | 4a01f36 | 2019-04-26 23:41:49 -0700 | [diff] [blame] | 125 | "libupdate_verifier", |
| 126 | |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 127 | "libgtest_prod", |
Tao Bao | 4a01f36 | 2019-04-26 23:41:49 -0700 | [diff] [blame] | 128 | "libprotobuf-cpp-lite", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 129 | ], |
| 130 | |
Tao Bao | 4a01f36 | 2019-04-26 23:41:49 -0700 | [diff] [blame] | 131 | data: [ |
| 132 | "testdata/*", |
| 133 | ":res-testdata", |
| 134 | ], |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | cc_test { |
| 138 | name: "recovery_manual_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 139 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 140 | |
| 141 | defaults: [ |
| 142 | "recovery_test_defaults", |
| 143 | ], |
| 144 | |
| 145 | test_suites: ["device-tests"], |
| 146 | |
| 147 | srcs: [ |
| 148 | "manual/recovery_test.cpp", |
| 149 | ], |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 150 | } |
| 151 | |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 152 | cc_test_host { |
| 153 | name: "recovery_host_test", |
Christopher Ferris | 272467d | 2018-08-22 19:38:49 -0700 | [diff] [blame] | 154 | isolated: true, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 155 | |
| 156 | defaults: [ |
| 157 | "recovery_test_defaults", |
Tianjie Xu | c3a161e | 2019-06-20 18:16:49 -0700 | [diff] [blame] | 158 | "libupdater_defaults", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 159 | ], |
| 160 | |
| 161 | srcs: [ |
Tianjie Xu | c3a161e | 2019-06-20 18:16:49 -0700 | [diff] [blame] | 162 | "unit/host/*", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 163 | ], |
| 164 | |
| 165 | static_libs: [ |
Tianjie Xu | c3a161e | 2019-06-20 18:16:49 -0700 | [diff] [blame] | 166 | "libupdater_host", |
| 167 | "libupdater_core", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 168 | "libimgdiff", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 169 | "libbsdiff", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 170 | "libdivsufsort64", |
| 171 | "libdivsufsort", |
Tianjie Xu | c3a161e | 2019-06-20 18:16:49 -0700 | [diff] [blame] | 172 | "libfstab", |
| 173 | "libc++fs", |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 174 | ], |
| 175 | |
Tao Bao | 83186dd | 2019-04-24 21:34:17 -0700 | [diff] [blame] | 176 | test_suites: ["general-tests"], |
| 177 | |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 178 | data: ["testdata/*"], |
Andreas Huber | 435dfac | 2018-08-15 16:11:25 -0700 | [diff] [blame] | 179 | |
| 180 | target: { |
| 181 | darwin: { |
Tianjie Xu | 45c40ec | 2019-07-02 15:09:24 -0700 | [diff] [blame] | 182 | // libapplypatch in "libupdater_defaults" is not available on the Mac. |
Andreas Huber | 435dfac | 2018-08-15 16:11:25 -0700 | [diff] [blame] | 183 | enabled: false, |
| 184 | }, |
| 185 | }, |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 186 | } |