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.
Note: there is the "A-rust-for-linux" label in the
rust
repository: https://github.com/rust-lang/rust/labels/A-rust-for-linux.Features that we would like to see
Required (we almost certainly want them)
Nice to have (not critical, we could workaround if needed, etc.)
Low priority (we will likely not use them in the end)
test
not depend onstd
.#![test_runner]
+#![reexport_test_harness_main]
as suggested by @bjorn3:std
wanted features & bugfixes #572 (comment).test
needs fromstd
at the moment.std
for tests.#[test(kernel)]
").-Zbuild-std
fixes & stabilization.Done (stabilized, fixed, not needed anymore, etc.)
A way to customize/override the dependency graph in
-Zbuild-std
to use our customalloc
etc.alloc
was dropped, so we do not need it anymore.A way to use
-Zbuild-std
for building custom sysroots (and not packages).-Zbuild-std
anymore.Bugs that we would like to see fixed
Required (we almost certainly want them)
Nice to have (probably not critical, we could workaround if needed, etc.)
Low priority (we will likely not use them in the end)
Done (stabilized, fixed, or not needed anymore, etc.)
The text was updated successfully, but these errors were encountered: