diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2021-11-23 03:31:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 13:31:01 +1100 |
commit | a24bdccee0580d1263733bc7e66e4e4f97713f19 (patch) | |
tree | 868cb12a436a87b39c936292f442bcc266ae0224 /tests/test_common/test_driver.hpp | |
parent | e20bc76a1e05d02c15a452e51fa76d9ec39b0369 (diff) | |
download | qmk_firmware-a24bdccee0580d1263733bc7e66e4e4f97713f19.tar.gz qmk_firmware-a24bdccee0580d1263733bc7e66e4e4f97713f19.zip |
[Tests] Increase QMK test coverage take 2 (#15269)
* Add per-test keymaps
* Add better trace and info logs for failed unit-tests
* Add layer state assertion with tracing message
* Use individual test binaries configuration options
* Add basic qmk functionality tests
* Add tap hold configurations tests
* Add auto shift tests
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'tests/test_common/test_driver.hpp')
-rw-r--r-- | tests/test_common/test_driver.hpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/tests/test_common/test_driver.hpp b/tests/test_common/test_driver.hpp index f86308df9..f9197b363 100644 --- a/tests/test_common/test_driver.hpp +++ b/tests/test_common/test_driver.hpp | |||
@@ -20,25 +20,26 @@ | |||
20 | #include <stdint.h> | 20 | #include <stdint.h> |
21 | #include "host.h" | 21 | #include "host.h" |
22 | #include "keyboard_report_util.hpp" | 22 | #include "keyboard_report_util.hpp" |
23 | 23 | #include "test_logger.hpp" | |
24 | 24 | ||
25 | class TestDriver { | 25 | class TestDriver { |
26 | public: | 26 | public: |
27 | TestDriver(); | 27 | TestDriver(); |
28 | ~TestDriver(); | 28 | ~TestDriver(); |
29 | void set_leds(uint8_t leds) { m_leds = leds; } | 29 | void set_leds(uint8_t leds) { m_leds = leds; } |
30 | 30 | ||
31 | MOCK_METHOD1(send_keyboard_mock, void (report_keyboard_t&)); | 31 | MOCK_METHOD1(send_keyboard_mock, void(report_keyboard_t&)); |
32 | MOCK_METHOD1(send_mouse_mock, void (report_mouse_t&)); | 32 | MOCK_METHOD1(send_mouse_mock, void(report_mouse_t&)); |
33 | MOCK_METHOD1(send_system_mock, void (uint16_t)); | 33 | MOCK_METHOD1(send_system_mock, void(uint16_t)); |
34 | MOCK_METHOD1(send_consumer_mock, void (uint16_t)); | 34 | MOCK_METHOD1(send_consumer_mock, void(uint16_t)); |
35 | private: | 35 | |
36 | static uint8_t keyboard_leds(void); | 36 | private: |
37 | static void send_keyboard(report_keyboard_t *report); | 37 | static uint8_t keyboard_leds(void); |
38 | static void send_mouse(report_mouse_t* report); | 38 | static void send_keyboard(report_keyboard_t* report); |
39 | static void send_system(uint16_t data); | 39 | static void send_mouse(report_mouse_t* report); |
40 | static void send_consumer(uint16_t data); | 40 | static void send_system(uint16_t data); |
41 | host_driver_t m_driver; | 41 | static void send_consumer(uint16_t data); |
42 | uint8_t m_leds = 0; | 42 | host_driver_t m_driver; |
43 | uint8_t m_leds = 0; | ||
43 | static TestDriver* m_this; | 44 | static TestDriver* m_this; |
44 | }; | 45 | }; |