switch off rdroidtest
rdroidtest doesn't work correctly with on-device tests because they use
`panic = "abort"` and rdroidtest doesn't support `-Zpanic-abort-tests`
yet. The result is that all test failure look like a "native crash" and
the test infra cannot correctly track them via bugs or display them in
the UI.
The only `rdroidtest` specific feature we used was `ignore_if`. It is a
bit of a loss to have ignored tests reported as passing, but it is a
lesser evil in this case.
Bug: 291169704
Bug: 384438979
Test: atest libdm_rust.test
Change-Id: I23af380c79a87d246a1f50e163415021d7f5fa84
diff --git a/libs/devicemapper/src/lib.rs b/libs/devicemapper/src/lib.rs
index a8c2833..bc8a762 100644
--- a/libs/devicemapper/src/lib.rs
+++ b/libs/devicemapper/src/lib.rs
@@ -230,14 +230,10 @@
}
#[cfg(test)]
-rdroidtest::test_main!();
-
-#[cfg(test)]
mod tests {
use super::*;
use crate::loopdevice::LoopConfigOptions;
use crypt::{CipherType, DmCryptTargetBuilder};
- use rdroidtest::{ignore_if, rdroidtest};
use rustutils::system_properties;
use std::fs::{read, File, OpenOptions};
use std::io::Write;
@@ -294,25 +290,29 @@
}
}
- #[rdroidtest]
+ #[test]
fn mapping_again_keeps_data_xts() {
mapping_again_keeps_data(&KEY_SET_XTS, "name1");
}
- #[rdroidtest]
- #[ignore_if(!is_hctr2_supported())]
+ #[test]
fn mapping_again_keeps_data_hctr2() {
+ if !is_hctr2_supported() {
+ return;
+ }
mapping_again_keeps_data(&KEY_SET_HCTR2, "name2");
}
- #[rdroidtest]
+ #[test]
fn data_inaccessible_with_diff_key_xts() {
data_inaccessible_with_diff_key(&KEY_SET_XTS, "name3");
}
- #[rdroidtest]
- #[ignore_if(!is_hctr2_supported())]
+ #[test]
fn data_inaccessible_with_diff_key_hctr2() {
+ if !is_hctr2_supported() {
+ return;
+ }
data_inaccessible_with_diff_key(&KEY_SET_HCTR2, "name4");
}