diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-17 02:57:57 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-17 02:57:57 +0000 |
commit | 357ec0c5a64e197ae53677fd641d6041da77cf2d (patch) | |
tree | e9112ccc69532822871b7fd658743d57d914dcbb | |
parent | cd9ff43c21a2a21d3b2c517199b70aa69bec0230 (diff) | |
parent | 7e6387d1f117d0ffebef0ac9c48eaf21ae751040 (diff) | |
download | libm-android13-frc-media-swcodec-release.tar.gz |
Snap for 8191477 from 7e6387d1f117d0ffebef0ac9c48eaf21ae751040 to tm-frc-media-swcodec-releaset_frc_swc_330443040t_frc_swc_330443010android13-frc-media-swcodec-release
Change-Id: I10a79e3de334e060580041af602cfde3b0bb1213
-rw-r--r-- | Android.bp | 32 | ||||
-rw-r--r-- | TEST_MAPPING | 20 | ||||
-rw-r--r-- | patches/test_build_fix.patch | 31 | ||||
-rw-r--r-- | src/math/pow.rs | 4 |
4 files changed, 61 insertions, 26 deletions
@@ -42,6 +42,8 @@ rust_library { name: "liblibm", host_supported: true, crate_name: "libm", + cargo_env_compat: true, + cargo_pkg_version: "0.2.1", srcs: ["src/lib.rs"], edition: "2018", features: ["default"], @@ -52,33 +54,19 @@ rust_library { min_sdk_version: "29", } -rust_defaults { - name: "libm_defaults", +rust_test { + name: "libm_test_src_lib", + host_supported: true, crate_name: "libm", + cargo_env_compat: true, + cargo_pkg_version: "0.2.1", srcs: ["src/lib.rs"], test_suites: ["general-tests"], auto_gen_config: true, - edition: "2018", - features: ["default"], - proc_macros: ["libno_panic"], -} - -rust_test_host { - name: "libm_host_test_src_lib", - defaults: ["libm_defaults"], test_options: { unit_test: true, }, + edition: "2018", + features: ["default"], + proc_macros: ["libno_panic"], } - -rust_test { - name: "libm_device_test_src_lib", - defaults: ["libm_defaults"], -} - -// dependent_library ["feature_list"] -// no-panic-0.1.15 -// proc-macro2-1.0.26 "default,proc-macro" -// quote-1.0.9 "default,proc-macro" -// syn-1.0.70 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote" -// unicode-xid-0.2.1 "default" diff --git a/TEST_MAPPING b/TEST_MAPPING index 06d8e5a..bfdf123 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,8 +1,24 @@ -// 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/quiche" + } + ], "presubmit": [ { - "name": "libm_device_test_src_lib" + "name": "doh_unit_test" + }, + { + "name": "libm_test_src_lib" + } + ], + "presubmit-rust": [ + { + "name": "doh_unit_test" + }, + { + "name": "libm_test_src_lib" } ] } diff --git a/patches/test_build_fix.patch b/patches/test_build_fix.patch new file mode 100644 index 0000000..82c3756 --- /dev/null +++ b/patches/test_build_fix.patch @@ -0,0 +1,31 @@ +From c18c704856ffa8b3349401300e66796d4cc8d4f5 Mon Sep 17 00:00:00 2001 +From: Jethro Beekman <jethro@fortanix.com> +Date: Thu, 24 Jun 2021 15:58:36 +0200 +Subject: [PATCH] Fix build failure with latest nightly + +--- + src/math/pow.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/math/pow.rs b/src/math/pow.rs +index c7fd0df..f79680a 100644 +--- a/src/math/pow.rs ++++ b/src/math/pow.rs +@@ -604,7 +604,7 @@ mod tests { + + // Factoring -1 out: + // (negative anything ^ integer should be (-1 ^ integer) * (positive anything ^ integer)) +- &[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS] ++ (&[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS]) + .iter() + .for_each(|int_set| { + int_set.iter().for_each(|int| { +@@ -616,7 +616,7 @@ mod tests { + + // Negative base (imaginary results): + // (-anything except 0 and Infinity ^ non-integer should be NAN) +- &NEG[1..(NEG.len() - 1)].iter().for_each(|set| { ++ (&NEG[1..(NEG.len() - 1)]).iter().for_each(|set| { + set.iter().for_each(|val| { + test_sets(&ALL[3..7], &|v: f64| pow(*val, v), &|_| NAN); + }) diff --git a/src/math/pow.rs b/src/math/pow.rs index ce8e83e..8b5989c 100644 --- a/src/math/pow.rs +++ b/src/math/pow.rs @@ -604,7 +604,7 @@ mod tests { // Factoring -1 out: // (negative anything ^ integer should be (-1 ^ integer) * (positive anything ^ integer)) - &[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS] + (&[POS_ZERO, NEG_ZERO, POS_ONE, NEG_ONE, POS_EVENS, NEG_EVENS]) .iter() .for_each(|int_set| { int_set.iter().for_each(|int| { @@ -616,7 +616,7 @@ mod tests { // Negative base (imaginary results): // (-anything except 0 and Infinity ^ non-integer should be NAN) - &NEG[1..(NEG.len() - 1)].iter().for_each(|set| { + (&NEG[1..(NEG.len() - 1)]).iter().for_each(|set| { set.iter().for_each(|val| { test_sets(&ALL[3..7], &|v: f64| pow(*val, v), &|_| NAN); }) |