Skip to content
Snippets Groups Projects
Select Git revision
  • main
  • keycloak-deprecate
  • remove-jwt-easy
  • ci-update
  • v0.1.15
  • v0.1.14
  • v0.1.13
  • v0.1.12
  • v0.1.11
  • v0.1.10
  • v0.1.9
  • v0.1.8
  • v0.1.7
  • v0.1.6
  • v0.1.5
  • v0.1.4
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
20 results

docs

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
#include <assert.h>

int main(){
    assert(1 == 1);

    return 0;
}
#include <assert.h>

int main(){
    assert(1 == 2);

    return 0;
}

Development

Folgende Pakete werden benötigt, um den SWEB-Tester zu entwickeln: The following packages and tools are needed to develop SWET

Installation & Setup

$ pip install tox pre-commit
$ pre-commit install