Merge "Build and run the zlib tests."
diff --git a/Android.bp b/Android.bp
index 50b7a01..74470f4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -169,6 +169,23 @@
     },
 }
 
+cc_test {
+    name: "zlib_tests",
+    srcs: [
+        "contrib/tests/infcover.cc",
+        "contrib/tests/utils_unittest.cc",
+        "google/compression_utils_portable.cc",
+    ],
+    include_dirs: [
+        "external/zlib/google",
+        // These tests include "gtest.h" rather than the usual "gtest/gtest.h".
+        "external/googletest/googletest/include/gtest/",
+    ],
+    shared_libs: ["libz"],
+    host_supported: true,
+    test_suites: ["device-tests"],
+}
+
 ndk_headers {
     name: "libz_headers",
     from: "",
diff --git a/TEST_MAPPING b/TEST_MAPPING
index d69ed96..e4164ec 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -18,6 +18,9 @@
       "name": "ziparchive-tests"
     },
     {
+      "name": "zlib_tests"
+    },
+    {
       "name": "CtsLibcoreTestCases",
       "options": [
         {