summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/README.md
blob: 8ea3dcdde1e7c3239a1dbec97f95a12ae1fc95b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
This is the combined driver test. The goal is to have many driver test suites
in one binary, so that compile time will be faster than many small tests, and
so we can test interactions between different subsystems easily.

## Run all the test suites

```bash
(chroot) zmake configure --test zephyr/test/drivers
```

To see all the output of zmake (for example if the build fails)

```bash
(chroot) zmake -l DEBUG -j 1 configure --test zephyr/test/drivers
```

## Code coverage

To calculate code coverage for this test only

```bash
(chroot) zmake configure --coverage --test zephyr/test/drivers
(chroot) lcov --gcov-tool ~/trunk/src/platform/ec/util/llvm-gcov.sh -q \
        -o build/zephyr/test/drivers/lcov.info -c -d build/zephyr/test/drivers
(chroot) genhtml -q -o build/zephyr/test/drivers/coverage_rpt \
        build/zephyr/test/drivers/lcov.info
```

The report will be in build/zephyr/test/drivers/coverage_rpt/index.html

## Debugging

You need the host version of gdb:

```bash
(chroot) sudo emerge -j sys-devel/gdb
```

Build the test
```bash
(chroot) zmake configure --build zephyr/test/drivers
```

Then run gdb

```
(chroot) gdb build/zephyr/test/drivers/build-singleimage/zephyr/zephyr.exe
# Set breakpoints, run, etc.
```