Drashna Jaelre eba78af8b5 Fix and add unit tests for Caps Word to work with Unicode Map, Auto Shift, Retro Shift. (#17284) (#348)
* Fix Caps Word and Unicode Map

* Tests for Caps Word + Auto Shift and Unicode Map.

* Fix formatting

* Add additional keyboard report expectation macros

This commit defines five test utilities, EXPECT_REPORT, EXPECT_UNICODE,
EXPECT_EMPTY_REPORT, EXPECT_ANY_REPORT and EXPECT_NO_REPORT for use with
TestDriver.

EXPECT_REPORT sets a gmock expectation that a given keyboard report will
be sent. For instance,

  EXPECT_REPORT(driver, (KC_LSFT, KC_A));

is shorthand for

  EXPECT_CALL(driver,
      send_keyboard_mock(KeyboardReport(KC_LSFT, KC_A)));

EXPECT_UNICODE sets a gmock expectation that a given Unicode code point
will be sent using UC_LNX input mode. For instance for U+2013,

  EXPECT_UNICODE(driver, 0x2013);

expects the sequence of keys:

  "Ctrl+Shift+U, 2, 0, 1, 3, space".

EXPECT_EMPTY_REPORT sets a gmock expectation that a given keyboard
report will be sent. For instance

  EXPECT_EMPTY_REPORT(driver);

expects a single report without keypresses or modifiers.

EXPECT_ANY_REPORT sets a gmock expectation that a arbitrary keyboard
report will be sent, without matching its contents. For instance

  EXPECT_ANY_REPORT(driver).Times(1);

expects a single arbitrary keyboard report will be sent.

EXPECT_NO_REPORT sets a gmock expectation that no keyboard report will
be sent at all.

* Add tap_key() and tap_keys() to TestFixture.

This commit adds a `tap_key(key)` method to TestFixture that taps a
given KeymapKey, optionally with a specified delay between press and
release.

Similarly, the method `tap_keys(key_a, key_b, key_c)` taps a sequence of
KeymapKeys.

* Use EXPECT_REPORT, tap_keys, etc. in most tests.

This commit uses EXPECT_REPORT, EXPECT_UNICODE, EXPECT_EMPTY_REPORT,
EXPECT_NO_REPORT, tap_key() and tap_keys() test utilities from the
previous two commits in most tests. Particularly the EXPECT_REPORT
macro is frequently useful and makes a nice reduction in boilerplate
needed to express many tests.

Co-authored-by: David Kosorin <david@kosorin.net>

Co-authored-by: Pascal Getreuer <50221757+getreuer@users.noreply.github.com>
Co-authored-by: David Kosorin <david@kosorin.net>
2022-07-01 16:12:54 +09:00
2022-05-24 02:20:12 +01:00
2022-02-11 20:00:34 -08:00
2022-03-25 16:19:22 -07:00
2019-10-01 10:21:12 +09:00
2022-04-13 18:00:18 +10:00
2022-04-13 18:00:18 +10:00

ZSA's fork of QMK Firmware

Current Version Build firmware Unit Tests GitHub contributors GitHub forks

This purpose of this fork is maintain a clean repo that only contains the keyboard code that we need, and as little else as possible. This is to keep it lightweight, since we only need a couple of keyboards. This is the repo that the EZ Configurator will pull from.

Documentation

The docs are powered by Docsify and hosted on GitHub. They are also viewable offline; see Previewing the Documentation for more details.

You can request changes by making a fork and opening a pull request, or by clicking the "Edit this page" link at the bottom of any page.

Supported Keyboards

Building

To set up the local build enviroment to create the firmware image manually, head to the Newbs guide from QMK. And instead of using just qmk setup, you will want to run this instead:

qmk setup zsa/qmk_firmware -b firmware20

Maintainers

QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, Hasu. The OLKB product firmwares are maintained by Jack Humbert, the Ergodox EZ by ZSA Technology Labs, the Clueboard by Zach White, and the Atreus by Phil Hagelberg.

Update Process

  1. Check out branch from ZSA's master branch:

    1. git remote add zsa https://github.com/zsa/qmk_firmware.git
    2. git fetch --all
    3. git checkout -B branchname zsa/master
    4. git push -u zsa branchname
  2. Check for core changes:

  3. git merge (hash|tag)

    • git rm -rf docs users layouts .vscode to remove the docs and user code that we don't want.
    • To remove all of the keyboard exept the ones we want:
      find ./keyboards -mindepth 1 -maxdepth 1 -type d -not -name ergodox_ez -not -name planck -not -name moonlander -not -name pytest -exec git rm -rf '{}' \;
      find ./keyboards/planck -mindepth 1 -maxdepth 1 -type d -not -name ez -not -name keymaps -exec git rm -rf '{}' \;
      
    • To remove all of the keymaps from folder that we don't want:
      find ./keyboards/ -mindepth 3 -maxdepth 3 -type d -not -name default -not -name oryx -not -name webusb -not -name glow -not -name reactive -not -name shine -not -name keymaps -exec git rm -rf '{}' \;
      
    • Restore necessary files/folders:
      git checkout HEAD -- keyboards/handwired/pytest
      git checkout HEAD -- layouts
      
    • Resolve merge conflicts, and commit.
  4. Commit update

    • Include commit info in [changelog.md](changelog.md)
  5. Open Pull request, and include information about the commit

Strategy

To keep PRs small and easier to test, they should ideally be 1:1 with commits from QMK Firmware master. They should only group commits if/when it makes sense. Such as multiple commits for a specific feature (split RGB support, for instance)

Description
No description provided
Readme 202 MiB
Languages
C 80.7%
C++ 13.5%
Python 3.4%
Makefile 1.9%
Shell 0.3%