make TRNG API test easier to run

since we're using it, might as well take it out of a comment
and turn it into a gated feature
This commit is contained in:
bunnie 2024-02-08 15:04:23 +08:00
parent e8599f5554
commit e48832a139
2 changed files with 5 additions and 3 deletions

View file

@ -145,6 +145,7 @@ shellperf = [
] # this also needs the project-wide "perfcounter" feature to be selected. shellchat is the exclusive manager of the performance counter, do not use with e.g. "vaultperf" feature
extra-tests = []
mass-storage = []
rand-api = []
locktests = [
] # for debugging some specific `std` tests cherry-picked out of the test suite
default = [] # "debugprint"

View file

@ -81,8 +81,9 @@ impl<'a> ShellCmdApi<'a> for TrngCmd {
}
write!(ret, "Pumped {}x1k values out of the engine", ROUNDS).unwrap();
}
// rand_core API tests - commented out because they only need to be run once, basically.
/*
// rand_core API tests - not included by default because it only needs to be run whenever
// the rand API is updated
#[cfg(feature = "rand-api")]
"api" => {
// the purpose of these tests is to check the edge-case code because
// the trng fetch is u32, but rand_core allows u8
@ -143,7 +144,7 @@ impl<'a> ShellCmdApi<'a> for TrngCmd {
let mut test4100 = [0u8; 4100];
OsRng.fill_bytes(&mut test4100);
log::info!("test 4100: {:?}", &test4100[4092..]);
} */
}
"errs" => {
write!(ret, "TRNG error stats: {:?}", env.trng.get_error_stats().unwrap()).unwrap();
}