aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2022-07-06 13:32:46 +0200
committerJeff Vander Stoep <jeffv@google.com>2022-07-06 13:32:46 +0200
commit78aefa6cf44a3e4960209e8ff57969b0e2ee24d7 (patch)
tree3252319c1d3473a526feb077b0414cbcfa9bd4db
parent05a37eb749117c732975d769cb7a19aa5c30055c (diff)
downloadhashbrown-78aefa6cf44a3e4960209e8ff57969b0e2ee24d7.tar.gz
Enable tests
Test: atest x86_64 hashbrown_test_src_lib: Passed: 86, Failed: 0, Ignored: 0, Assumption Failed: 0, x86_64 hashbrown_test_tests_hasher: Passed: 4, Failed: 0, Ignored: 0, Assumption Failed: 0, x86_64 hashbrown_test_tests_set: Passed: 1, Failed: 0, Ignored: 0, Assumption Failed: 0, Change-Id: I6b8deec516bbb5c0ae7e61b197e5ea67a2a7287d
-rw-r--r--Android.bp72
-rw-r--r--TEST_MAPPING18
-rw-r--r--cargo2android.json6
3 files changed, 94 insertions, 2 deletions
diff --git a/Android.bp b/Android.bp
index b35773f..03c21e3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -37,6 +37,78 @@ license {
],
}
+rust_test {
+ name: "hashbrown_test_src_lib",
+ host_supported: true,
+ crate_name: "hashbrown",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.12.1",
+ srcs: ["src/lib.rs"],
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ test_options: {
+ unit_test: true,
+ },
+ edition: "2021",
+ features: [
+ "ahash",
+ "default",
+ "inline-more",
+ ],
+ rustlibs: [
+ "libahash",
+ "libfnv",
+ "liblazy_static",
+ "librand",
+ "librayon",
+ "libserde_test",
+ ],
+}
+
+rust_defaults {
+ name: "hashbrown_test_defaults",
+ crate_name: "hashbrown",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.12.1",
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ edition: "2021",
+ features: [
+ "ahash",
+ "default",
+ "inline-more",
+ ],
+ rustlibs: [
+ "libahash",
+ "libfnv",
+ "libhashbrown",
+ "liblazy_static",
+ "librand",
+ "librayon",
+ "libserde_test",
+ ],
+}
+
+rust_test {
+ name: "hashbrown_test_tests_hasher",
+ defaults: ["hashbrown_test_defaults"],
+ host_supported: true,
+ srcs: ["tests/hasher.rs"],
+ test_options: {
+ unit_test: true,
+ },
+}
+
+rust_test {
+ name: "hashbrown_test_tests_set",
+ defaults: ["hashbrown_test_defaults"],
+ host_supported: true,
+ srcs: ["tests/set.rs"],
+ test_options: {
+ unit_test: true,
+ },
+}
+
rust_library {
name: "libhashbrown",
host_supported: true,
diff --git a/TEST_MAPPING b/TEST_MAPPING
index aa301aa..e3e692f 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,6 +2,15 @@
{
"presubmit": [
{
+ "name": "hashbrown_test_src_lib"
+ },
+ {
+ "name": "hashbrown_test_tests_hasher"
+ },
+ {
+ "name": "hashbrown_test_tests_set"
+ },
+ {
"name": "keystore2_legacy_blobs_test"
},
{
@@ -13,6 +22,15 @@
],
"presubmit-rust": [
{
+ "name": "hashbrown_test_src_lib"
+ },
+ {
+ "name": "hashbrown_test_tests_hasher"
+ },
+ {
+ "name": "hashbrown_test_tests_set"
+ },
+ {
"name": "keystore2_legacy_blobs_test"
},
{
diff --git a/cargo2android.json b/cargo2android.json
index bf78496..41494dc 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,4 +1,6 @@
{
"device": true,
- "run": true
-} \ No newline at end of file
+ "patch": "patches/Android.bp.patch",
+ "run": true,
+ "tests": true
+}