tock / book

Tock Hands-on Guide
MIT License
10 stars 11 forks source link

add Kernel Tests section to book #7

Closed hudson-ayers closed 4 years ago

hudson-ayers commented 4 years ago

This PR adds a "Kernel Tests" section to the "Kernel Development Guides" section of the Tock book.

The process for writing a kernel test seems to vary a decent amount depending on what you are testing, but I tried to provide insight into how to pick between the few different approaches that show up in the main repository (cargo tests // capsule tests // board-specific tests). I also tried to show examples from a few different tests and some of my thinking when I am approaching writing a kernel test.

Any feedback is welcome!

Also, when I run mdbook build I get a ton of changes across a bunch of html and js files unrelated to my changes. I assume this is a versioning issue with my mdbook or similar, but I decided not to push updated HTML files until someone can provide a pointer about how I can avoid that issue.

hudson-ayers commented 4 years ago

Ideally the book HTML would be auto generated, but currently we just do it manually. Changing the table of contents leads to many changed files, so having unrelated file changes is expected.

Even if I check out the current version of the repo with no changes:

hudson: ~/book-tock (master) $ mdbook build
hudson: ~/book-tock (master) $ git diff --stat
 book/application.html                      |  99 ++++----
 book/ayu-highlight.css                     |   4 +-
 book/book.js                               | 250 +++++++++---------
 book/capsule.html                          | 189 +++++++-------
 book/course.html                           |  99 ++++----
 book/css/chrome.css                        |  90 +++++--
 book/css/general.css                       |  31 ++-
 book/css/variables.css                     |  43 ++++
 book/development/guides.html               |  99 ++++----
 book/development/hil.html                  |  97 ++++---
 book/development/peripheral.html           | 189 +++++++-------
 book/development/sensor.html               | 207 +++++++--------
 book/development/syscall.html              | 189 +++++++-------
 book/environment.html                      |  99 ++++----
 book/graduation.html                       |  99 ++++----
 book/guides.html                           |  99 ++++----
 book/highlight.js                          |   4 +-
 book/important_client.html                 |  99 ++++----
 book/index.html                            | 103 ++++----
 book/introduction.html                     |  97 ++++---
 book/modules.html                          |  99 ++++----
 book/prerequisites.html                    |  99 ++++----
 book/print.html                            | 473 +++++++++++++++++++----------------
 book/tutorials/01_running_blink.html       |  99 ++++----
 book/tutorials/02_button_print.html        |  99 ++++----
 book/tutorials/03_ble_scan.html            |  99 ++++----
 book/tutorials/04_sensors_and_drivers.html |  99 ++++----
 book/tutorials/05_ipc.html                 |  99 ++++----
 book/tutorials/tutorials.html              |  99 ++++----
 29 files changed, 1783 insertions(+), 1668 deletions(-)

This doesn't seem right to me..

hudson-ayers commented 4 years ago

I am pretty sure I am just using a different version of mdbook. Is it okay for me to add all of those changes to this PR?

bradjc commented 4 years ago

Yes. I don't think this is worth worrying about without setting up some automatic build.