Merge "Refresh Android.bp, cargo2android.json, TEST_MAPPING." am: 5ac950e338

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/vulkano/+/1912662

Change-Id: Ib0d56a48eaaf86bacb2b324a69bfef9f76a94825
diff --git a/Android.bp b/Android.bp
index fa9215f..43c3c35 100644
--- a/Android.bp
+++ b/Android.bp
@@ -46,7 +46,6 @@
 
 rust_library {
     name: "libvulkano",
-    // has rustc warnings
     host_supported: true,
     crate_name: "vulkano",
     cargo_env_compat: true,
@@ -72,18 +71,23 @@
     ],
 }
 
-rust_defaults {
-    name: "vulkano_test_defaults",
+rust_test {
+    name: "vulkano_test_src_lib",
+    host_supported: true,
     crate_name: "vulkano",
-    // has rustc warnings
+    cargo_env_compat: true,
+    cargo_pkg_version: "0.25.0",
     srcs: [
         "src/lib.rs",
         ":copy_vulkano_build_out",
     ],
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.25.0",
     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: false,
+    },
     edition: "2018",
     rustlibs: [
         "libash_rust",
@@ -96,18 +100,3 @@
         "libsmallvec",
     ],
 }
-
-rust_test_host {
-    name: "vulkano_host_test_src_lib",
-    defaults: ["vulkano_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: "vulkano_device_test_src_lib",
-    defaults: ["vulkano_test_defaults"],
-}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index b205cd1..958c404 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,10 +1,2 @@
 // 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": "vulkano_device_test_src_lib"
-    //}
-  ]
-}
+{}
diff --git a/build.rs b/build.rs
index 4da24a1..1f2b2bf 100644
--- a/build.rs
+++ b/build.rs
@@ -7,8 +7,6 @@
 // notice may not be copied, modified, or distributed except
 // according to those terms.
 
-#![feature(str_split_once)]
-
 use std::{env, fs::File, io::BufWriter, path::Path};
 
 mod autogen;
diff --git a/cargo2android.json b/cargo2android.json
index d6a9e94..ea92969 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -5,7 +5,7 @@
   ],
   "copy-out": true,
   "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 97e8d62..669a5e8 100644
--- a/patches/Android.bp.patch
+++ b/patches/Android.bp.patch
@@ -2,15 +2,16 @@
 index 8e11707..a156cb8 100644
 --- a/Android.bp
 +++ b/Android.bp
-@@ -62,8 +62,10 @@ rust_defaults {
- rust_test_host {
-     name: "vulkano_host_test_src_lib",
-     defaults: ["vulkano_test_defaults"],
+@@ -62,9 +62,11 @@ rust_test {
+     ],
+     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: "2018",
+     rustlibs: [
  
diff --git a/patches/build.rs.patch b/patches/build.rs.patch
deleted file mode 100644
index 4af564f..0000000
--- a/patches/build.rs.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/build.rs b/build.rs
-index 1f2b2bf5..4da24a10 100644
---- a/build.rs
-+++ b/build.rs
-@@ -7,6 +7,8 @@
- // notice may not be copied, modified, or distributed except
- // according to those terms.
- 
-+#![feature(str_split_once)]
-+
- use std::{env, fs::File, io::BufWriter, path::Path};
- 
- mod autogen;