move extra tests behind a feature flag

This commit is contained in:
bunnie 2023-01-02 14:58:58 +08:00
parent 6266d8a74d
commit ee14188a4d

View file

@ -10,7 +10,7 @@ use core::fmt::Write;
use core::sync::atomic::{AtomicBool, Ordering, AtomicU32}; use core::sync::atomic::{AtomicBool, Ordering, AtomicU32};
use std::sync::Arc; use std::sync::Arc;
use num_traits::*; use num_traits::*;
#[cfg(feature="extra-tests")]
use std::time::Instant; use std::time::Instant;
static AUDIO_OQC: AtomicBool = AtomicBool::new(false); static AUDIO_OQC: AtomicBool = AtomicBool::new(false);
@ -129,9 +129,11 @@ impl<'a> ShellCmdApi<'a> for Test {
if let Some(sub_cmd) = tokens.next() { if let Some(sub_cmd) = tokens.next() {
match sub_cmd { match sub_cmd {
#[cfg(feature="extra-tests")]
"panic" => { "panic" => {
assert!(1 == 0, "Panic test: 1 == 0 failure!"); assert!(1 == 0, "Panic test: 1 == 0 failure!");
} }
#[cfg(feature="extra-tests")]
"instant" => { "instant" => {
write!(ret, "start elapsed_ms {}\n", env.ticktimer.elapsed_ms()).unwrap(); write!(ret, "start elapsed_ms {}\n", env.ticktimer.elapsed_ms()).unwrap();
let now = Instant::now(); let now = Instant::now();
@ -612,10 +614,12 @@ impl<'a> ShellCmdApi<'a> for Test {
env.llio.wfi_override(false).unwrap(); env.llio.wfi_override(false).unwrap();
} }
#[cfg(feature="extra-tests")]
"devboot" => { "devboot" => {
env.gam.set_devboot(true).unwrap(); env.gam.set_devboot(true).unwrap();
write!(ret, "devboot on").unwrap(); write!(ret, "devboot on").unwrap();
} }
#[cfg(feature="extra-tests")]
"devbootoff" => { "devbootoff" => {
// this should do nothing if devboot was already set // this should do nothing if devboot was already set
env.gam.set_devboot(false).unwrap(); env.gam.set_devboot(false).unwrap();
@ -652,6 +656,7 @@ impl<'a> ShellCmdApi<'a> for Test {
"modals" => { "modals" => {
modals::tests::spawn_test(); modals::tests::spawn_test();
} }
#[cfg(feature="extra-tests")]
"bip39" => { "bip39" => {
let modals = modals::Modals::new(&env.xns).unwrap(); let modals = modals::Modals::new(&env.xns).unwrap();
// 4. bip39 display test // 4. bip39 display test