Enable tests

Now that fxhash has been imported, tests can be enabled.

Test: atest
Change-Id: I7b689cab58872fb1afa70fe9d08aefc16f751d21
diff --git a/Android.bp b/Android.bp
index 260ac53..8f1d565 100644
--- a/Android.bp
+++ b/Android.bp
@@ -37,6 +37,72 @@
     ],
 }
 
+rust_test {
+    name: "hashlink_test_src_lib",
+    host_supported: true,
+    crate_name: "hashlink",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.7.0",
+    srcs: ["src/lib.rs"],
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    test_options: {
+        unit_test: true,
+    },
+    edition: "2018",
+    rustlibs: [
+        "libfxhash",
+        "libhashbrown",
+        "libserde_test",
+    ],
+}
+
+rust_defaults {
+    name: "hashlink_test_defaults",
+    crate_name: "hashlink",
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.7.0",
+    test_suites: ["general-tests"],
+    auto_gen_config: true,
+    edition: "2018",
+    rustlibs: [
+        "libfxhash",
+        "libhashbrown",
+        "libhashlink",
+        "libserde_test",
+    ],
+}
+
+rust_test {
+    name: "hashlink_test_tests_linked_hash_map",
+    defaults: ["hashlink_test_defaults"],
+    host_supported: true,
+    srcs: ["tests/linked_hash_map.rs"],
+    test_options: {
+        unit_test: true,
+    },
+}
+
+rust_test {
+    name: "hashlink_test_tests_linked_hash_set",
+    defaults: ["hashlink_test_defaults"],
+    host_supported: true,
+    srcs: ["tests/linked_hash_set.rs"],
+    test_options: {
+        unit_test: true,
+    },
+}
+
+rust_test {
+    name: "hashlink_test_tests_lru_cache",
+    defaults: ["hashlink_test_defaults"],
+    host_supported: true,
+    srcs: ["tests/lru_cache.rs"],
+    test_options: {
+        unit_test: true,
+    },
+}
+
 rust_library {
     name: "libhashlink",
     host_supported: true,
@@ -48,4 +114,8 @@
     rustlibs: [
         "libhashbrown",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "//apex_available:anyapex",
+    ],
 }
diff --git a/TEST_MAPPING b/TEST_MAPPING
index aa301aa..31412aa 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,6 +2,18 @@
 {
   "presubmit": [
     {
+      "name": "hashlink_test_src_lib"
+    },
+    {
+      "name": "hashlink_test_tests_linked_hash_map"
+    },
+    {
+      "name": "hashlink_test_tests_linked_hash_set"
+    },
+    {
+      "name": "hashlink_test_tests_lru_cache"
+    },
+    {
       "name": "keystore2_legacy_blobs_test"
     },
     {
@@ -13,6 +25,18 @@
   ],
   "presubmit-rust": [
     {
+      "name": "hashlink_test_src_lib"
+    },
+    {
+      "name": "hashlink_test_tests_linked_hash_map"
+    },
+    {
+      "name": "hashlink_test_tests_linked_hash_set"
+    },
+    {
+      "name": "hashlink_test_tests_lru_cache"
+    },
+    {
       "name": "keystore2_legacy_blobs_test"
     },
     {
diff --git a/cargo2android.json b/cargo2android.json
index bf78496..ff6df50 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,4 +1,5 @@
 {
   "device": true,
-  "run": true
-}
\ No newline at end of file
+  "run": true,
+  "tests": true
+}