2018-07-25 00:34:39 +02:00
|
|
|
// Copyright (C) 2018 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2021-02-13 03:00:57 +01:00
|
|
|
package {
|
|
|
|
// See: http://go/android-license-faq
|
|
|
|
// A large-scale-change added 'default_applicable_licenses' to import
|
|
|
|
// all of the 'license_kinds' from "bootable_recovery_license"
|
|
|
|
// to get the below license kinds:
|
|
|
|
// SPDX-license-identifier-Apache-2.0
|
|
|
|
default_applicable_licenses: ["bootable_recovery_license"],
|
|
|
|
}
|
|
|
|
|
2018-07-25 00:34:39 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "recovery_test_defaults",
|
|
|
|
|
|
|
|
defaults: [
|
|
|
|
"recovery_defaults",
|
|
|
|
],
|
|
|
|
|
|
|
|
include_dirs: [
|
|
|
|
"bootable/recovery",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libcrypto",
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
|
|
|
"libpng",
|
2019-01-25 06:33:42 +01:00
|
|
|
"libprocessgroup",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libselinux",
|
|
|
|
"libziparchive",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
shared_libs: [
|
|
|
|
"libutils",
|
2019-12-18 02:51:42 +01:00
|
|
|
"libvndksupport",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
host: {
|
|
|
|
static_libs: [
|
|
|
|
"libutils",
|
|
|
|
],
|
2018-10-02 00:55:56 +02:00
|
|
|
},
|
2018-07-25 00:34:39 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-07-03 00:09:24 +02:00
|
|
|
// libapplypatch, libapplypatch_modes
|
2018-07-25 00:34:39 +02:00
|
|
|
libapplypatch_static_libs = [
|
|
|
|
"libapplypatch_modes",
|
|
|
|
"libapplypatch",
|
|
|
|
"libedify",
|
|
|
|
"libotautil",
|
|
|
|
"libbsdiff",
|
|
|
|
"libbspatch",
|
|
|
|
"libdivsufsort",
|
|
|
|
"libdivsufsort64",
|
|
|
|
"libutils",
|
|
|
|
"libbase",
|
|
|
|
"libbrotli",
|
|
|
|
"libbz",
|
2021-01-12 20:42:56 +01:00
|
|
|
"libz_stable",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libziparchive",
|
|
|
|
]
|
|
|
|
|
|
|
|
// librecovery_defaults uses many shared libs that we want to avoid using in tests (e.g. we don't
|
|
|
|
// have 32-bit android.hardware.health@2.0.so or libbootloader_message.so on marlin).
|
|
|
|
librecovery_static_libs = [
|
|
|
|
"librecovery",
|
|
|
|
"librecovery_fastboot",
|
2019-03-23 00:08:52 +01:00
|
|
|
"libinstall",
|
|
|
|
"librecovery_ui",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libminui",
|
2019-04-27 08:41:49 +02:00
|
|
|
"libfusesideload",
|
|
|
|
"libbootloader_message",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libotautil",
|
|
|
|
|
|
|
|
"libhealthhalutils",
|
|
|
|
"libvintf",
|
|
|
|
|
|
|
|
"android.hardware.health@2.0",
|
|
|
|
"android.hardware.health@1.0",
|
|
|
|
"libext4_utils",
|
|
|
|
"libfs_mgr",
|
|
|
|
"libhidl-gen-utils",
|
|
|
|
"libhidlbase",
|
2018-12-03 22:44:01 +01:00
|
|
|
"liblp",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libtinyxml2",
|
2019-08-06 21:32:05 +02:00
|
|
|
"libc++fs",
|
2018-07-25 00:34:39 +02:00
|
|
|
]
|
|
|
|
|
2020-02-21 08:09:44 +01:00
|
|
|
// recovery image for unittests.
|
|
|
|
// ========================================================
|
|
|
|
genrule {
|
|
|
|
name: "recovery_image",
|
2023-06-21 01:36:41 +02:00
|
|
|
cmd: "cat $(location testdata/recovery_head) <(cat $(location testdata/recovery_body) | gzip) $(location testdata/recovery_tail) > $(out)",
|
2020-02-21 08:09:44 +01:00
|
|
|
srcs: [
|
|
|
|
"testdata/recovery_head",
|
|
|
|
"testdata/recovery_body",
|
|
|
|
"testdata/recovery_tail",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"testdata/recovery.img",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-07-25 00:34:39 +02:00
|
|
|
cc_test {
|
|
|
|
name: "recovery_unit_test",
|
2018-08-23 04:38:49 +02:00
|
|
|
isolated: true,
|
2019-09-19 17:08:54 +02:00
|
|
|
require_root: true,
|
2018-07-25 00:34:39 +02:00
|
|
|
|
|
|
|
defaults: [
|
|
|
|
"recovery_test_defaults",
|
2019-04-27 08:41:49 +02:00
|
|
|
"libupdater_defaults",
|
2019-05-22 23:34:12 +02:00
|
|
|
"libupdater_device_defaults",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
test_suites: ["device-tests"],
|
|
|
|
|
2022-02-18 07:03:12 +01:00
|
|
|
tidy_timeout_srcs: [
|
|
|
|
"unit/commands_test.cpp",
|
|
|
|
],
|
|
|
|
|
2018-07-25 00:34:39 +02:00
|
|
|
srcs: [
|
2018-08-16 00:18:48 +02:00
|
|
|
"unit/*.cpp",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
|
|
|
|
2021-12-01 01:39:00 +01:00
|
|
|
shared_libs: [
|
|
|
|
"libbinder_ndk",
|
|
|
|
],
|
|
|
|
|
2019-04-27 08:41:49 +02:00
|
|
|
static_libs: libapplypatch_static_libs + librecovery_static_libs + [
|
2021-12-01 01:39:00 +01:00
|
|
|
"android.hardware.health-translate-ndk",
|
2022-11-24 13:45:47 +01:00
|
|
|
"android.hardware.health-V2-ndk",
|
2021-12-01 01:39:00 +01:00
|
|
|
"libhealthshim",
|
2018-07-25 00:34:39 +02:00
|
|
|
"librecovery_ui",
|
2019-03-22 16:54:35 +01:00
|
|
|
"libfusesideload",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libminui",
|
2019-10-01 20:55:36 +02:00
|
|
|
"librecovery_utils",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libotautil",
|
2019-05-22 23:34:12 +02:00
|
|
|
"libupdater_device",
|
|
|
|
"libupdater_core",
|
2019-04-27 08:41:49 +02:00
|
|
|
"libupdate_verifier",
|
|
|
|
|
|
|
|
"libprotobuf-cpp-lite",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
2021-04-20 20:58:05 +02:00
|
|
|
header_libs: [
|
|
|
|
"libgtest_prod_headers",
|
|
|
|
],
|
2018-07-25 00:34:39 +02:00
|
|
|
|
2019-04-27 08:41:49 +02:00
|
|
|
data: [
|
|
|
|
"testdata/*",
|
2020-02-21 08:09:44 +01:00
|
|
|
":recovery_image",
|
2019-04-27 08:41:49 +02:00
|
|
|
":res-testdata",
|
|
|
|
],
|
2018-07-25 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "recovery_manual_test",
|
2018-08-23 04:38:49 +02:00
|
|
|
isolated: true,
|
2018-07-25 00:34:39 +02:00
|
|
|
|
|
|
|
defaults: [
|
|
|
|
"recovery_test_defaults",
|
|
|
|
],
|
|
|
|
|
|
|
|
test_suites: ["device-tests"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"manual/recovery_test.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_test_host {
|
|
|
|
name: "recovery_host_test",
|
2018-08-23 04:38:49 +02:00
|
|
|
isolated: true,
|
2018-07-25 00:34:39 +02:00
|
|
|
|
|
|
|
defaults: [
|
|
|
|
"recovery_test_defaults",
|
2019-06-21 03:16:49 +02:00
|
|
|
"libupdater_defaults",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
|
|
|
|
2022-02-18 07:03:12 +01:00
|
|
|
tidy_timeout_srcs: [
|
|
|
|
"unit/host/imgdiff_test.cpp",
|
|
|
|
],
|
|
|
|
|
2018-07-25 00:34:39 +02:00
|
|
|
srcs: [
|
2019-06-21 03:16:49 +02:00
|
|
|
"unit/host/*",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
2019-06-21 03:16:49 +02:00
|
|
|
"libupdater_host",
|
|
|
|
"libupdater_core",
|
2018-07-25 00:34:39 +02:00
|
|
|
"libimgdiff",
|
|
|
|
"libbsdiff",
|
|
|
|
"libdivsufsort64",
|
|
|
|
"libdivsufsort",
|
2019-06-21 03:16:49 +02:00
|
|
|
"libfstab",
|
|
|
|
"libc++fs",
|
2018-07-25 00:34:39 +02:00
|
|
|
],
|
|
|
|
|
2019-04-25 06:34:17 +02:00
|
|
|
test_suites: ["general-tests"],
|
2022-08-04 19:05:43 +02:00
|
|
|
test_config: "RecoveryHostTest.xml",
|
2019-04-25 06:34:17 +02:00
|
|
|
|
2018-07-25 00:34:39 +02:00
|
|
|
data: ["testdata/*"],
|
2018-08-16 01:11:25 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
darwin: {
|
2019-07-03 00:09:24 +02:00
|
|
|
// libapplypatch in "libupdater_defaults" is not available on the Mac.
|
2018-08-16 01:11:25 +02:00
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
2018-07-25 00:34:39 +02:00
|
|
|
}
|
2020-11-10 23:26:17 +01:00
|
|
|
|
|
|
|
cc_fuzz {
|
|
|
|
name: "libinstall_verify_package_fuzzer",
|
|
|
|
defaults: [
|
|
|
|
"recovery_test_defaults",
|
|
|
|
],
|
|
|
|
|
|
|
|
srcs: ["fuzz/verify_package_fuzzer.cpp"],
|
|
|
|
|
|
|
|
corpus: [
|
|
|
|
"testdata/otasigned*.zip",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libotautil",
|
|
|
|
"libinstall",
|
|
|
|
"librecovery_ui",
|
|
|
|
"libminui",
|
|
|
|
],
|
|
|
|
}
|