The greedy match was including whitespace if more than one space character
separated the "keyswitch" token and the first coordinate.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
Even if a testcase shouldn't generate any HID reports, we should verify that it
didn't. If it does generate a report when there are none expected, that test
should fail.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
This replaces the `CHECK_EXPECTED_REPORTS()` macro with a new `CheckReports()`
method. The new method verifies both the content and timestamps of expected
keyboard reports, and provides more output on failures (including details of any
unexpected reports).
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
class for each generated test file. removing
this makes test definitions simpler
Also, grow support for multiple tests within a script
Signed-off-by: Jesse Vincent <jesse@keyboard.io>
This change adds a set of functions to the `VirtualDeviceTest` class to make it
possible to write simpler testcases involving timed keyswitch press and release
events along with corresponding keyboard HID reports.
Other outputs (Consumer & System Control HID reports, LEDs, et cetera) are
not yet included.
Instead of ignoring the return value of RUN_ALL_TESTS, exit with the same status
code. This will make failing tests actually fail the build, instead of logging
the error, and then exiting successfully.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This change adds the keycodes for keyboard modifier keys to the vector returned
by KeyboardReport::ActiveKeycodes(). Also, a simple method for getting the
modifiers byte from a keyboard hid report.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
Because the Arduino build system doesn't -really- interface well with Makefiles, there's no other way to pick up Kaleidoscope or sketch changes from Make. This -does- slow down sim builds / test runs a bit.
Fixes#942
For now, this is just a wrapper around RunCycles(n), but the two could diverge
in the future. RunMillis(t) should always cause `t` milliseconds to elapse in
the simulator, regardless of how many cycles that takes.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
This commit adds versions of `SimHarness::Press()` and `SimHarness::Release()`
functions that use a `KeyAddr` parameter instead of row & column integers.
to build the test.
Instead of unconditionally running the arduino-based build parts in verbose
mode, respect $VERBOSE. This cuts down on the amount of output we generate by
default, while still allowing us to have a verbose mode if need be.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
To silence a warning, explicitly ignore the return value of `RUN_ALL_TESTS`: we
exit on failure anyway, the return value isn't useful for us in any way.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Instead of running the tests right after compiling them, compile them all first,
then run them one after another. This way the test output is kept much closer
together, which is easier to glance over.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
We do a number of things here:
- Bump the distro version from Trusty to Bionic, because we need newer tools.
- Install cmake.
- Unset CC, because it interferes with our virtual builds.
- Run the googletest-based suite before building the examples
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This adds a googletest-based test harness (with googletest pulled into
`testing/googletest`, so we have a fixed state of it), and a few test
cases that demonstrate its use.
Original work by Eric Paniagua in #898, with minor cleanups by Gergely
Nagy.
Signed-off-by: Eric Paniagua <epaniagua@google.com>
Signed-off-by: Gergely Nagy <algernon@keyboard.io>