aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-07-25 17:18:09 +0100
committerGitHub <noreply@github.com>2021-07-25 17:18:09 +0100
commitfc9fb2c77505cf1dcf5d1f50dd61a980471b3494 (patch)
tree3dce233f23dbe991c4dee0a63eb4dc0fe9c2b6f5 /docs
parentb69e7431aa2e22b4f4662c64e84ed242caac055e (diff)
downloadqmk_firmware-fc9fb2c77505cf1dcf5d1f50dd61a980471b3494.tar.gz
qmk_firmware-fc9fb2c77505cf1dcf5d1f50dd61a980471b3494.zip
Allow output of logging when running unit tests (#13556)
* Initial pass at enabling logging for unit tests * Add to docs * Bind debug for more test types * Force everything * Tidy up slightly
Diffstat (limited to 'docs')
-rw-r--r--docs/faq_debug.md2
-rw-r--r--docs/unit_testing.md10
2 files changed, 10 insertions, 2 deletions
diff --git a/docs/faq_debug.md b/docs/faq_debug.md
index 13a649bfa..1afa38a62 100644
--- a/docs/faq_debug.md
+++ b/docs/faq_debug.md
@@ -28,7 +28,7 @@ For compatible platforms, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) can
28 28
29Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available. 29Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available.
30 30
31## Sending Your Own Debug Messages 31## Sending Your Own Debug Messages :id=debug-api
32 32
33Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file: 33Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
34 34
diff --git a/docs/unit_testing.md b/docs/unit_testing.md
index 82073a201..a0eef51cb 100644
--- a/docs/unit_testing.md
+++ b/docs/unit_testing.md
@@ -36,12 +36,20 @@ Note how there's several different tests, each mocking out a separate part. Also
36 36
37## Running the Tests 37## Running the Tests
38 38
39To run all the tests in the codebase, type `make test`. You can also run test matching a substring by typing `make test:matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer. 39To run all the tests in the codebase, type `make test:all`. You can also run test matching a substring by typing `make test:matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
40 40
41## Debugging the Tests 41## Debugging the Tests
42 42
43If there are problems with the tests, you can find the executable in the `./build/test` folder. You should be able to run those with GDB or a similar debugger. 43If there are problems with the tests, you can find the executable in the `./build/test` folder. You should be able to run those with GDB or a similar debugger.
44 44
45To forward any [debug messages](unit_testing.md#debug-api) to `stderr`, the tests can run with `DEBUG=1`. For example
46
47```console
48make test:all DEBUG=1
49```
50
51Alternatively, add `CONSOLE_ENABLE=yes` to the tests `rules.mk`.
52
45## Full Integration Tests 53## Full Integration Tests
46 54
47It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing. 55It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing.