aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-12-09 14:44:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-12-09 14:44:23 +0000
commitd5ebf60999fda6072934512a41a78d7484b71303 (patch)
treecc45dd741041014d3ed158ff611a4e889ba4209e
parent0b3587ae70e533aa9c5c0425c3ca6a3f0a018bd1 (diff)
parenta39d0483d6225775905fc5d307e5b79f0e792de7 (diff)
downloadspin-d5ebf60999fda6072934512a41a78d7484b71303.tar.gz
Merge "Android.bp: add tests"
-rw-r--r--Android.bp28
-rw-r--r--TEST_MAPPING12
-rw-r--r--patches/Android.bp.patch20
3 files changed, 58 insertions, 2 deletions
diff --git a/Android.bp b/Android.bp
index 84a401c..20556ca 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --device --run --dependencies.
+// This file is generated by cargo2android.py --run --device --dependencies --tests --patch=patches/Android.bp.patch.
rust_library {
name: "libspin",
@@ -8,7 +8,31 @@ rust_library {
edition: "2015",
features: [
"default",
+ "std",
"ticket_mutex",
- "std",
],
}
+
+rust_defaults {
+ name: "spin_defaults",
+ crate_name: "spin",
+ srcs: ["src/lib.rs"],
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ edition: "2015",
+ features: [
+ "default",
+ "std",
+ "ticket_mutex",
+ ],
+}
+
+rust_test_host {
+ name: "spin_host_test_src_lib",
+ defaults: ["spin_defaults"],
+}
+
+rust_test {
+ name: "spin_device_test_src_lib",
+ defaults: ["spin_defaults"],
+}
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..6e9bd8c
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,12 @@
+// Generated by cargo2android.py for tests in Android.bp
+{
+ "presubmit": [
+ {
+ "host": true,
+ "name": "spin_host_test_src_lib"
+ },
+ {
+ "name": "spin_device_test_src_lib"
+ }
+ ]
+}
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
new file mode 100644
index 0000000..db27b2e
--- /dev/null
+++ b/patches/Android.bp.patch
@@ -0,0 +1,20 @@
+diff --git a/Android.bp b/Android.bp
+index 96531ab..43db8ef 100644
+--- a/Android.bp
++++ b/Android.bp
+@@ -8,6 +8,7 @@ rust_library {
+ edition: "2015",
+ features: [
+ "default",
++ "std",
+ "ticket_mutex",
+ ],
+ }
+@@ -21,6 +22,7 @@ rust_defaults {
+ edition: "2015",
+ features: [
+ "default",
++ "std",
+ "ticket_mutex",
+ ],
+ }