SWET für SWEB
SWET (Schon wieder ein Testsystem) is a Testrunner for SWEB (Schon wieder ein Betriebssystem). SWET makes all the necessary patches to sweb, injects the tests and detects if the test succeeded or failed.
Installation
SWET can be installed via pip
.
However, the package is not beeing distributed via PyPI
but via the gitlab package registry.
Installation of SWET
Since this is a private repository, it is manditory to use a personal access token to interact with the package-registry.
Gitlab Personal Access Token: Create an Access Token
The package can be installed via pip as follows:
Danach kann der Paket über pip wie folgt installiert werden:
$
Writing of SWET-Tests
SWET searches for tests in userspace/tests
.
It is important, that test
is in the filename. If this is not the case,
then SWET will not considere it as a test and ignors it.
It is wise to either use test_*.c
or *_test.c
for all tests.
When does a test fail
A test fails if one of the following conditions occurs:
- An assertion fails
- A kernal-panic occurs
Example Testcases
The following codesnippets are examples for passing and failing tests
Passing Testcode | Failing Testcode |
---|---|
|
|
Development
Folgende Pakete werden benötigt, um den SWEB-Tester zu entwickeln: The following packages and tools are needed to develop SWET
- python >= 3.7
- tox
- Optional: virtualenv, pre-commit
Installation & Setup
$ pip install tox pre-commit
$ pre-commit install