phil-opp / blog_os

Writing an OS in Rust

Home Page:http://os.phil-opp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests seem to run for both lib and main

tomadimitrie opened this issue · comments

Hi, I am following the blog, currently at the tests post. The tests seem to run twice:

Running unittests src/lib.rs (target/target/debug/deps/os-700045f9d1cee9a8)
...
Running unittests src/main.rs (target/target/debug/deps/os-72fe698e079ceb87)

Both files call test_main so the tests run twice. Any idea why? I compared my code with the post-04 branch and seems to be the same.

Thank you! Awesome work btw :)

That's how testing in Rust works. Libraries are built and tested separately from binaries.