Merge "Refresh Android.bp, cargo2android.json, TEST_MAPPING." am: 26dbc6db75 am: 44f6e7b8c1 am: 8d317d2351 am: dcf0bf827a
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/shared_library/+/1912834
Change-Id: Icf34655ca25be108235900200e12b2a162f2f976
diff --git a/Android.bp b/Android.bp
index 9db6e2d..28ea619 100644
--- a/Android.bp
+++ b/Android.bp
@@ -57,32 +57,23 @@
],
}
-rust_defaults {
- name: "shared_library_test_defaults",
+rust_test {
+ name: "shared_library_test_src_lib",
+ host_supported: true,
crate_name: "shared_library",
- srcs: ["src/lib.rs"],
cargo_env_compat: true,
cargo_pkg_version: "0.1.9",
+ srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
- edition: "2015",
- rustlibs: [
- "liblazy_static",
- "liblibc",
- ],
-}
-
-rust_test_host {
- name: "shared_library_host_test_src_lib",
- defaults: ["shared_library_test_defaults"],
// Manually disabled as these tests depend on specific graphics libraries
// being available on the machine running the tests.
test_options: {
unit_test: false,
},
-}
-
-rust_test {
- name: "shared_library_device_test_src_lib",
- defaults: ["shared_library_test_defaults"],
+ edition: "2015",
+ rustlibs: [
+ "liblazy_static",
+ "liblibc",
+ ],
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index cf54784..f439cf8 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,13 +1,8 @@
// Generated by update_crate_tests.py for tests that depend on this crate.
{
- "presubmit": [
- // Manually disabled as these tests depend on specific graphics libraries
- // being available on the machine running the tests.
- //{
- // "name": "shared_library_device_test_src_lib"
- //},
- //{
- // "name": "vulkano_device_test_src_lib"
- //}
+ "imports": [
+ {
+ "path": "external/rust/crates/vulkano"
+ }
]
}
diff --git a/cargo2android.json b/cargo2android.json
index 9a0499e..bbea40c 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -4,7 +4,7 @@
"com.android.virt"
],
"device": true,
+ "patch": "patches/Android.bp.patch",
"run": true,
- "tests": true,
- "patch": "patches/Android.bp.patch"
+ "tests": true
}
\ No newline at end of file
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
index 7eb1f13..32794df 100644
--- a/patches/Android.bp.patch
+++ b/patches/Android.bp.patch
@@ -2,15 +2,16 @@
index 3e82eff..550133f 100644
--- a/Android.bp
+++ b/Android.bp
-@@ -35,8 +35,10 @@ rust_defaults {
- rust_test_host {
- name: "shared_library_host_test_src_lib",
- defaults: ["shared_library_test_defaults"],
+@@ -35,9 +35,11 @@ rust_test {
+ srcs: ["src/lib.rs"],
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ // Manually disabled as these tests depend on specific graphics libraries
+ // being available on the machine running the tests.
test_options: {
- unit_test: true,
+ unit_test: false,
},
- }
+ edition: "2015",
+ rustlibs: [