summaryrefslogtreecommitdiffstats
path: root/tests/Android.bp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Android.bp')
-rw-r--r--tests/Android.bp55
1 files changed, 52 insertions, 3 deletions
diff --git a/tests/Android.bp b/tests/Android.bp
index 4c23255ad..5ef4d58c0 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -12,6 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+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"],
+}
+
cc_defaults {
name: "recovery_test_defaults",
@@ -31,7 +40,6 @@ cc_defaults {
"libpng",
"libprocessgroup",
"libselinux",
- "libz",
"libziparchive",
],
@@ -65,7 +73,7 @@ libapplypatch_static_libs = [
"libbase",
"libbrotli",
"libbz",
- "libz",
+ "libz_stable",
"libziparchive",
]
@@ -95,6 +103,24 @@ librecovery_static_libs = [
"libc++fs",
]
+// recovery image for unittests.
+// ========================================================
+genrule {
+ name: "recovery_image",
+ cmd: "cat $(location testdata/recovery_head) <(cat $(location testdata/recovery_body) | $(location minigzip)) $(location testdata/recovery_tail) > $(out)",
+ srcs: [
+ "testdata/recovery_head",
+ "testdata/recovery_body",
+ "testdata/recovery_tail",
+ ],
+ tools: [
+ "minigzip",
+ ],
+ out: [
+ "testdata/recovery.img",
+ ],
+}
+
cc_test {
name: "recovery_unit_test",
isolated: true,
@@ -122,12 +148,15 @@ cc_test {
"libupdater_core",
"libupdate_verifier",
- "libgtest_prod",
"libprotobuf-cpp-lite",
],
+ header_libs: [
+ "libgtest_prod_headers",
+ ],
data: [
"testdata/*",
+ ":recovery_image",
":res-testdata",
],
}
@@ -182,3 +211,23 @@ cc_test_host {
},
},
}
+
+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",
+ ],
+}