diff --git a/tests/Android.bp b/tests/Android.bp index bde1bc5f..3d223907 100644 --- a/tests/Android.bp +++ b/tests/Android.bp @@ -94,6 +94,24 @@ librecovery_static_libs = [ "libtinyxml2", ] +// 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, @@ -127,6 +145,7 @@ cc_test { data: [ "testdata/*", + ":recovery_image", ":res-testdata", ], } diff --git a/tests/testdata/recovery.img b/tests/testdata/recovery.img deleted file mode 100644 index b862e6f0..00000000 Binary files a/tests/testdata/recovery.img and /dev/null differ diff --git a/tests/testdata/recovery_body b/tests/testdata/recovery_body new file mode 100644 index 00000000..48d7c10a Binary files /dev/null and b/tests/testdata/recovery_body differ diff --git a/tests/testdata/recovery_head b/tests/testdata/recovery_head new file mode 100644 index 00000000..7f494d09 Binary files /dev/null and b/tests/testdata/recovery_head differ diff --git a/tests/testdata/recovery_tail b/tests/testdata/recovery_tail new file mode 100644 index 00000000..7fe2c6ce Binary files /dev/null and b/tests/testdata/recovery_tail differ