summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-04-06 12:45:52 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-06 21:12:14 +0000
commit9e47a78b42333224c84e1e2c2abf418174783745 (patch)
treef8fbd5d281fc6046bb624f444028879f929f444b
parent17bfe503fc51c048a86d99d5e4e23ad2ee08c5a1 (diff)
downloadchrome-ec-9e47a78b42333224c84e1e2c2abf418174783745.tar.gz
ec: Add instructions on debugging tests
For host based tests, add instructions on emerging and running gdb. BRANCH=none BUG=b:178484932 TEST=doc change only Change-Id: I5c99d2699134d732e4596a0ce9acffb39c22bda6 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2805225 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r--docs/unit_tests.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/unit_tests.md b/docs/unit_tests.md
index 1b79b727d8..f26a8519c8 100644
--- a/docs/unit_tests.md
+++ b/docs/unit_tests.md
@@ -26,6 +26,23 @@ Build and run all unit tests:
(chroot) ~/trunk/src/platform/ec $ make runhosttests -j
```
+## Debugging Unit Tests
+
+You need the host version of gdb:
+
+```bash
+(chroot) sudo emerge -j sys-devel/gdb
+```
+
+Then run gdb on the specific test you want to debug (the `host_command` test in this example):
+
+```
+(chroot) gdb build/host/host_command/host_command.exe
+handle SIGUSR1 noprint nostop
+break test_hostcmd_ok
+run
+```
+
## Writing Unit Tests
Unit tests live in the [`test`] subdirectory of the CrOS EC codebase.