aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-10 07:01:38 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-10 07:01:38 +0000
commitcfb47a3a429cef4722c097a70768e4d305372457 (patch)
tree922148d864e3db4510c9ac0118a0c1a4a95056de
parent8d895366089df6377d66967371f86ece5197c720 (diff)
parentb1ee0ccbff33d19ad765f5b8da493d0f9473f82b (diff)
downloadcfg-if-android13-mainline-wifi-release.tar.gz
Change-Id: I50261832dce8506a922adcd8780ed93e657772c5
-rw-r--r--Android.bp46
-rw-r--r--TEST_MAPPING256
-rw-r--r--cargo2android.json8
-rw-r--r--src/lib.rs1
4 files changed, 273 insertions, 38 deletions
diff --git a/Android.bp b/Android.bp
index b8d90c9..752ec2e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -37,63 +37,55 @@ license {
],
}
-rust_defaults {
- name: "cfg-if_defaults",
+rust_test {
+ name: "cfg-if_test_src_lib",
+ host_supported: true,
crate_name: "cfg_if",
+ cargo_env_compat: true,
+ cargo_pkg_version: "1.0.0",
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
- edition: "2018",
-}
-
-rust_test_host {
- name: "cfg-if_host_test_src_lib",
- defaults: ["cfg-if_defaults"],
test_options: {
unit_test: true,
},
+ edition: "2018",
}
rust_test {
- name: "cfg-if_device_test_src_lib",
- defaults: ["cfg-if_defaults"],
-}
-
-rust_defaults {
- name: "cfg-if_defaults_xcrate",
+ name: "cfg-if_test_tests_xcrate",
+ host_supported: true,
crate_name: "xcrate",
+ cargo_env_compat: true,
+ cargo_pkg_version: "1.0.0",
srcs: ["tests/xcrate.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
+ test_options: {
+ unit_test: true,
+ },
edition: "2018",
rustlibs: [
"libcfg_if",
],
}
-rust_test_host {
- name: "cfg-if_host_test_tests_xcrate",
- defaults: ["cfg-if_defaults_xcrate"],
- test_options: {
- unit_test: true,
- },
-}
-
-rust_test {
- name: "cfg-if_device_test_tests_xcrate",
- defaults: ["cfg-if_defaults_xcrate"],
-}
-
rust_library {
name: "libcfg_if",
host_supported: true,
crate_name: "cfg_if",
+ cargo_env_compat: true,
+ cargo_pkg_version: "1.0.0",
srcs: ["src/lib.rs"],
edition: "2018",
apex_available: [
"//apex_available:platform",
+ "com.android.bluetooth",
+ "com.android.compos",
"com.android.resolv",
+ "com.android.uwb",
"com.android.virt",
],
+ vendor_available: true,
min_sdk_version: "29",
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 40be7a2..da760e2 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,29 +1,267 @@
-// Generated by cargo2android.py for tests in Android.bp
+// Generated by update_crate_tests.py for tests that depend on this crate.
{
+ "imports": [
+ {
+ "path": "external/rust/crates/android_logger"
+ },
+ {
+ "path": "external/rust/crates/ash"
+ },
+ {
+ "path": "external/rust/crates/base64"
+ },
+ {
+ "path": "external/rust/crates/cast"
+ },
+ {
+ "path": "external/rust/crates/crc32fast"
+ },
+ {
+ "path": "external/rust/crates/crossbeam-deque"
+ },
+ {
+ "path": "external/rust/crates/crossbeam-epoch"
+ },
+ {
+ "path": "external/rust/crates/crossbeam-queue"
+ },
+ {
+ "path": "external/rust/crates/crossbeam-utils"
+ },
+ {
+ "path": "external/rust/crates/env_logger"
+ },
+ {
+ "path": "external/rust/crates/futures-util"
+ },
+ {
+ "path": "external/rust/crates/gdbstub_arch"
+ },
+ {
+ "path": "external/rust/crates/getrandom"
+ },
+ {
+ "path": "external/rust/crates/jni"
+ },
+ {
+ "path": "external/rust/crates/libsqlite3-sys"
+ },
+ {
+ "path": "external/rust/crates/mio"
+ },
+ {
+ "path": "external/rust/crates/once_cell"
+ },
+ {
+ "path": "external/rust/crates/parking_lot_core"
+ },
+ {
+ "path": "external/rust/crates/quiche"
+ },
+ {
+ "path": "external/rust/crates/quickcheck"
+ },
+ {
+ "path": "external/rust/crates/rand_chacha"
+ },
+ {
+ "path": "external/rust/crates/rand_core"
+ },
+ {
+ "path": "external/rust/crates/rand_xorshift"
+ },
+ {
+ "path": "external/rust/crates/regex"
+ },
+ {
+ "path": "external/rust/crates/ryu"
+ },
+ {
+ "path": "external/rust/crates/serde-xml-rs"
+ },
+ {
+ "path": "external/rust/crates/tinytemplate"
+ },
+ {
+ "path": "external/rust/crates/tinyvec"
+ },
+ {
+ "path": "external/rust/crates/tokio"
+ },
+ {
+ "path": "external/rust/crates/tokio-test"
+ },
+ {
+ "path": "external/rust/crates/unicode-xid"
+ },
+ {
+ "path": "external/rust/crates/vulkano"
+ }
+ ],
"presubmit": [
{
- "name": "cfg-if_device_test_src_lib"
+ "name": "ZipFuseTest"
+ },
+ {
+ "name": "apkdmverity.test"
+ },
+ {
+ "name": "authfs_device_test_src_lib"
+ },
+ {
+ "name": "cfg-if_test_src_lib"
+ },
+ {
+ "name": "cfg-if_test_tests_xcrate"
+ },
+ {
+ "name": "diced_open_dice_cbor_test"
+ },
+ {
+ "name": "diced_sample_inputs_test"
+ },
+ {
+ "name": "diced_test"
+ },
+ {
+ "name": "diced_utils_test"
+ },
+ {
+ "name": "diced_vendor_test"
+ },
+ {
+ "name": "doh_unit_test"
+ },
+ {
+ "name": "keystore2_crypto_test_rust"
+ },
+ {
+ "name": "keystore2_selinux_concurrency_test"
+ },
+ {
+ "name": "keystore2_selinux_test"
+ },
+ {
+ "name": "keystore2_test"
+ },
+ {
+ "name": "keystore2_test_utils_test"
+ },
+ {
+ "name": "legacykeystore_test"
+ },
+ {
+ "name": "libapkverify.integration_test"
+ },
+ {
+ "name": "libapkverify.test"
+ },
+ {
+ "name": "logger_device_unit_tests"
+ },
+ {
+ "name": "logger_test_config_log_level"
+ },
+ {
+ "name": "logger_test_default_init"
+ },
+ {
+ "name": "logger_test_env_log_level"
+ },
+ {
+ "name": "logger_test_multiple_init"
+ },
+ {
+ "name": "microdroid_manager_test"
+ },
+ {
+ "name": "rustBinderTest"
+ },
+ {
+ "name": "virtualizationservice_device_test"
+ }
+ ],
+ "presubmit-rust": [
+ {
+ "name": "ZipFuseTest"
+ },
+ {
+ "name": "apkdmverity.test"
+ },
+ {
+ "name": "authfs_device_test_src_lib"
+ },
+ {
+ "name": "cfg-if_test_src_lib"
+ },
+ {
+ "name": "cfg-if_test_tests_xcrate"
+ },
+ {
+ "name": "diced_open_dice_cbor_test"
+ },
+ {
+ "name": "diced_sample_inputs_test"
+ },
+ {
+ "name": "diced_test"
+ },
+ {
+ "name": "diced_utils_test"
+ },
+ {
+ "name": "diced_vendor_test"
+ },
+ {
+ "name": "doh_unit_test"
+ },
+ {
+ "name": "keystore2_crypto_test_rust"
+ },
+ {
+ "name": "keystore2_selinux_concurrency_test"
+ },
+ {
+ "name": "keystore2_selinux_test"
+ },
+ {
+ "name": "keystore2_test"
+ },
+ {
+ "name": "keystore2_test_utils_test"
+ },
+ {
+ "name": "legacykeystore_test"
+ },
+ {
+ "name": "libapkverify.integration_test"
+ },
+ {
+ "name": "libapkverify.test"
+ },
+ {
+ "name": "logger_device_unit_tests"
},
{
- "name": "cfg-if_device_test_tests_xcrate"
+ "name": "logger_test_config_log_level"
},
{
- "name": "env_logger_device_test_src_lib"
+ "name": "logger_test_default_init"
},
{
- "name": "rand_core_device_test_src_lib"
+ "name": "logger_test_env_log_level"
},
{
- "name": "getrandom_device_test_src_lib"
+ "name": "logger_test_multiple_init"
},
{
- "name": "android_logger_device_test_src_lib"
+ "name": "microdroid_manager_test"
},
{
- "name": "parking_lot_core_device_test_src_lib"
+ "name": "rustBinderTest"
},
{
- "name": "libsqlite3-sys_device_test_src_lib"
+ "name": "virtualizationservice_device_test"
}
]
}
diff --git a/cargo2android.json b/cargo2android.json
index 5412b5b..19c5df8 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,12 +1,16 @@
{
"apex-available": [
"//apex_available:platform",
+ "com.android.bluetooth",
+ "com.android.compos",
"com.android.resolv",
+ "com.android.uwb",
"com.android.virt"
],
"dependencies": true,
"device": true,
"min-sdk-version": "29",
"run": true,
- "tests": true
-} \ No newline at end of file
+ "tests": true,
+ "vendor-available": true
+}
diff --git a/src/lib.rs b/src/lib.rs
index 41fe587..485e1a7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,6 +29,7 @@
#![cfg_attr(test, deny(warnings))]
// ANDROID: Use std to allow building as a dylib.
+#[cfg(android_dylib)]
extern crate std;
/// The main macro provided by this crate. See crate documentation for more