Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime testing framework #12

Closed
SamTebbs33 opened this issue May 8, 2019 · 5 comments · Fixed by #48
Closed

Runtime testing framework #12

SamTebbs33 opened this issue May 8, 2019 · 5 comments · Fixed by #48
Assignees
Labels
testing Relates to testing the kernel
Projects
Milestone

Comments

@SamTebbs33
Copy link
Collaborator

SamTebbs33 commented May 8, 2019

It would be useful to implement a system for testing the kernel at runtime. This would be used to test components of the kernel, such as paging, multitasking and the filesystem.

A possible approach to running a certain testcase would be to boot the kernel in testing mode (perhaps with a build specific for that testcase), have it initialise the component being tested and printing to serial with some predetermined format based on success or failure. A program could then be attached to the kernel's serial port ensuring that the correct output is received.

The results could then be compiled into a testing report.

Possible dependency on #37 if serial output is how we monitor test results.

@SamTebbs33 SamTebbs33 added the testing Relates to testing the kernel label May 8, 2019
@SamTebbs33 SamTebbs33 added this to To do in General via automation May 8, 2019
@SamTebbs33
Copy link
Collaborator Author

@SamTebbs33
Copy link
Collaborator Author

https://forum.osdev.org/viewtopic.php?t=17948

@DrDeano
Copy link
Member

DrDeano commented May 31, 2019

Not sure if we have the money for that ;)

@SamTebbs33
Copy link
Collaborator Author

Didn't stop me buying an core 2 duo laptop from 2006 😂 £10 well spent

@SamTebbs33
Copy link
Collaborator Author

SamTebbs33 commented Jun 23, 2019

I've been exploring our options with this. My current design idea is as follows:

  • When you want to do a runtime test of the kernel, you build it with zig build -Drt-test=true which then sets a flag in build.zig and builds as normal.
  • The source files will check for that flag in the build file (using @build to refer to it) and add some logging specific to testing if the flag is set.
  • The new build can be tested with zig build test -Drt-test=true, which will run a test harness.
  • This test harness will run zig build run and attach itself to the emulators stdout so that it can capture the serial output.
  • The test harness will then check the output to make sure all test logs are emitted and are correct. The results are then printed in a readable way.

@SamTebbs33 SamTebbs33 self-assigned this Jun 30, 2019
General automation moved this from To do to Done Jul 9, 2019
@SamTebbs33 SamTebbs33 added this to the v0.1 milestone Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Relates to testing the kernel
Projects
No open projects
General
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants