twizzler-operating-system / twizzler

The Twizzler Operating System
BSD 3-Clause "New" or "Revised" License
66 stars 14 forks source link

Implement kernel test case running. #58

Closed dbittman closed 2 years ago

dbittman commented 2 years ago

The kernel will now run tests after booting up if test mode is enabled (--tests on the kernel command line). Since it's the kernel, there are a few assumptions we have to make:

  1. Tests will only run if the kernel is able to boot to the point where it can run tests.
  2. If any test cases in the kernel fail, it will immediately stop running tests and quit Qemu. This means other tests won't run, and userspace tests won't run.
  3. Writing tests for the kernel is a bit different than in userspace. The tests are built into the system and are run after startup, after which the kernel is expected to behave normally (as if tests didn't run). Secondly, you have to write #[test_case] instead of #[test].