summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/README.md
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-04-09 10:21:39 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-12 17:54:21 +0000
commitbd2b1eb38349dcc736c5ec6763abdeb87e48aa16 (patch)
treec1c939743baaa263171c4d5b524f1e4886e5b5ba /zephyr/test/drivers/README.md
parentf334d6f9d4116eeb4999293108abf8fe147d6f83 (diff)
downloadchrome-ec-bd2b1eb38349dcc736c5ec6763abdeb87e48aa16.tar.gz
zephyr: Shell of driver ztest.
Create a shell of a test that can have many test suites for device drivers. Currently this test only checks that the EC_BATT_PRES_ODL can be read correctly by battery_is_present(). But it links in many device drivers and is a starting point for the next test. BUG=b:185118990 TEST=It is one BRANCH=none Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I07c8835015cbe0fec6aaf82f782400e894043a90 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2819029 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/test/drivers/README.md')
-rw-r--r--zephyr/test/drivers/README.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/zephyr/test/drivers/README.md b/zephyr/test/drivers/README.md
new file mode 100644
index 0000000000..8ea3dcdde1
--- /dev/null
+++ b/zephyr/test/drivers/README.md
@@ -0,0 +1,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.
+```
+