tosc-rs / mnemos

An Operating System for Building Small Computers
https://mnemos.dev
Apache License 2.0
253 stars 18 forks source link

test: run doctests in `just test`, fix broken doctests #282

Closed hawkw closed 1 year ago

hawkw commented 1 year ago

Because we're using cargo nextest, which can't easily learn about doctests from RustDoc, the just test command currently only runs normal unit and integration tests. This means that we have a bunch of doctests which were silently not being run on CI or when running tests locally through the Justfile. Whoopsie!

This branch adds a cargo test --doc invocation to just test as well, so that doctests are also run. Since CI also invokes just test, we don't need to do anything else to ensure that doctests also happen on CI.

After fixing this, I found that a bunch of our doctests are currently broken, because...we were never actually testing them lol. In particular: