0

I'm writing a simple kernel/OS with help from https://os.phil-opp.com. when I got the step about testing I could not for the life of me get it working so I ended up skipping it altogether, but now my lack of testing is starting to get quite annoying. This is the code that I am using.

#![feature(custom_test_frameworks)]
#![test_runner(crate::test_runner)]
...
#[cfg(test)]
fn test_runner(tests: &[&dyn Fn()]) {
    println!("Running tests");
    for test in tests {
        test();
    }
}

When I put it in lib.rs cargo test yields error: requires `start` lang_item. When I put it in main.rs cargo test yields error[E0463]: can't find crate for `test. The help for E0463 doesn't provide much help at all unfortunately.

0 Answers0