You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For no-std testing there is the unstable #![test_runner] + #![reexport_test_harness_main]. This was implemented in rust-lang/rust#53410. See https://os.phil-opp.com/testing/ for an example. To copy the example there:
#![feature(custom_test_frameworks)]#![test_runner(crate::test_runner)]#![reexport_test_harness_main = "test_main"]#[cfg(test)]fntest_runner(tests:&[&dynFn()]){println!("Running {} tests", tests.len());for test in tests {test();}}#[no_mangle]pubextern"C"fn_start() -> ! {println!("Hello World{}","!");#[cfg(test)]test_main();loop{}}#[test_case]fntrivial_assertion(){print!("trivial assertion... ");assert_eq!(1,1);println!("[ok]");}
I believe I have already linked it before by the way.
Activity
bjorn3 commentedon Nov 27, 2021
For no-std testing there is the unstable
#![test_runner]+#![reexport_test_harness_main]. This was implemented in rust-lang/rust#53410. See https://os.phil-opp.com/testing/ for an example. To copy the example there:I believe I have already linked it before by the way.
ojeda commentedon Nov 27, 2021
Thanks! I think you did, yeah. Linked in the list to avoid missing it again :)
I was filling this one to keep track of some of the bits from the meeting the other day that were not yet in the list.