Skip to content

Commit 1d2a2b4

Browse files
SorinOlarikr-t
authored andcommitted
docs(tests): update documentation to include system testing for zephyr
Signed-off-by: SorinO <sorin.olari2@gmail.com>
1 parent c0f49c7 commit 1d2a2b4

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

docs/tests/SystemTests.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ System Tests are tests designed to test the entire system as a black box,
44
including all components and dependencies.
55
We usually build it in release mode, so we test exactly what we are delivering.
66

7-
Currently, these are only available for the POSIX platform.
7+
Currently, these are available for POSIX and Zephyr platforms.
88

99
However, these are also sometimes reused for memory [leak checks](LeakChecks.md) and [source code coverage generation](CoverageReports.md).
1010
In these cases, Ocre needs to be built with instrumentation so it is not testing the release build.
1111
For more information on those, refer to their specific documentation.
1212

1313
These tests are configured in the CI workflows as a quality gate. All PRs must pass all of them.
1414

15-
## Build and run
15+
## Linux
16+
17+
### Build and run
1618

1719
Create a build directory and navigate to it:
1820

@@ -47,7 +49,7 @@ You can also run the individual test executable binaries `test_*` in the build d
4749

4850
Note that the tests must be run from the build directory, because they look for images in the current working directory + `./ocre/src/ocre/var/lib/ocre/images/`.
4951

50-
## Details
52+
### Details
5153

5254
The individual test binaries:
5355

@@ -62,3 +64,34 @@ Follow a similar pattern. `test_lib` is testing the general library initializati
6264
`test_container` tests the specific functionality of a specific container.
6365

6466
Please, refer to their source code for more details.
67+
68+
## Zephyr
69+
70+
### Build and run
71+
To build the Zephyr system tests for the `native_sim_64` board:
72+
73+
```sh
74+
west build -p always -b native_sim/native/64 tests/system/zephyr/context
75+
```
76+
77+
Replace `context` with `container`, `lib`, or `ocre` to build different tests:
78+
79+
- `tests/system/zephyr/lib` - Tests the general library initialization functions
80+
- `tests/system/zephyr/ocre` - Tests the Ocre library and management of contexts
81+
- `tests/system/zephyr/context` - Tests context functionality, creating and managing the lifetime of containers
82+
- `tests/system/zephyr/container` - Tests the specific functionality of a container
83+
84+
To run the test:
85+
```sh
86+
west build -t run
87+
```
88+
89+
The last lines of the output will be something like:
90+
```
91+
-----------------------
92+
25 Tests 0 Failures 0 Ignored
93+
OK
94+
```
95+
96+
### Details
97+
Each test must be run individually. Run the build command for one test at a time, then execute `west build -t run` to run that specific test.

0 commit comments

Comments
 (0)