diff options
author | Joel Challis <[email protected]> | 2021-07-25 17:18:09 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-25 17:18:09 +0100 |
commit | fc9fb2c77505cf1dcf5d1f50dd61a980471b3494 (patch) | |
tree | 3dce233f23dbe991c4dee0a63eb4dc0fe9c2b6f5 /tests/test_common/main.cpp | |
parent | b69e7431aa2e22b4f4662c64e84ed242caac055e (diff) | |
download | qmk_firmware-0.13.26.tar.gz qmk_firmware-0.13.26.zip |
Allow output of logging when running unit tests (#13556)0.13.26
* 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 'tests/test_common/main.cpp')
-rw-r--r-- | tests/test_common/main.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_common/main.cpp b/tests/test_common/main.cpp new file mode 100644 index 0000000000..3e4b4c0f95 --- /dev/null +++ b/tests/test_common/main.cpp @@ -0,0 +1,32 @@ +#include "gtest/gtest.h" + +extern "C" { +#include "stdio.h" +#include "debug.h" + +int8_t sendchar(uint8_t c) { + fprintf(stderr, "%c", c); + return 0; +} + +__attribute__((weak)) debug_config_t debug_config = {0}; + +void init_logging(void) { + print_set_sendchar(sendchar); + + // Customise these values to desired behaviour + // debug_enable = true; + // debug_matrix = true; + // debug_keyboard = true; + // debug_mouse = true; + debug_config.raw = 0xFF; +} +} + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + + init_logging(); + + return RUN_ALL_TESTS(); +}
\ No newline at end of file |