spiegel-keyman/common/core/desktop/tests/unit/kmx
Marc Durdin b23df3fbc8 feat(web): &newLayer and &oldLayer
Fixes #6364.

Removes `&layerChanged` and adds `&newLayer` and `&oldLayer` system
stores with the additional nuances around values as described in #6364.
2022-03-13 08:29:15 +11:00
..
template chore(common/core): Compile test keyboards to .kmp 2021-11-02 19:37:45 +01:00
000 - null keyboard.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
000 - null keyboard.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
001 - basic input UnicodeI.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
001 - basic input UnicodeI.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
002 - basic input Unicode.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
002 - basic input Unicode.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
003 - nul.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
003 - nul.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
004 - basic input (shift 2).kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
004 - basic input (shift 2).kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
005 - nul with initial context.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
005 - nul with initial context.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
006 - vkey input (shift ctrl).kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
006 - vkey input (shift ctrl).kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
007 - vkey input (ctrl alt).kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
007 - vkey input (ctrl alt).kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
008 - vkey input (ctrl alt 2).kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
008 - vkey input (ctrl alt 2).kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
012 - ralt.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
012 - ralt.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
013 - deadkeys.kmn fix(linux): Address code review comments 2021-08-19 12:15:42 +02:00
013 - deadkeys.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
014 - groups and virtual keys.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
014 - groups and virtual keys.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
015 - ralt 2.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
015 - ralt 2.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
017 - space mnemonic kbd.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
017 - space mnemonic kbd.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
018 - nul testing.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
018 - nul testing.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
019 - multiple deadkeys.kmn chore(common/core): address review comments 2021-07-27 07:08:30 +10:00
019 - multiple deadkeys.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
020 - deadkeys and backspace.kmn chore(linux): Add integration tests for ibus-keyman 2021-11-04 09:22:28 +01:00
020 - deadkeys and backspace.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
021 - options.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
021 - options.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
022 - options with preset.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
022 - options with preset.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
023 - options with save.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
023 - options with save.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
024 - options with save and preset.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
024 - options with save and preset.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
025 - options with reset.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
025 - options with reset.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
026 - system stores.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
026 - system stores.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
027 - system stores 2.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
027 - system stores 2.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
028 - smp.kmn fix(common/core/desktop): split smp for context chars 2021-08-06 12:28:15 +10:00
028 - smp.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
029 - beep.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
029 - beep.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
030 - multiple groups.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
030 - multiple groups.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
031 - caps lock.kmn fix(linux): Address code review comments 2021-08-19 12:15:42 +02:00
031 - caps lock.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
032 - caps control.kmn feat(common/core): Implement shiftFreesCaps and capsOnOnly 2021-08-06 16:13:58 +02:00
032 - caps control.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
033 - caps always off.kmn feat(common/core): Implement capsAlwaysOff system store 2021-07-23 10:25:28 +02:00
033 - caps always off.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
034 - options double set reset.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
034 - options double set reset.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
035 - options double set staged.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
035 - options double set staged.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
036 - options - double reset staged.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
036 - options - double reset staged.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
037 - options - double reset.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
037 - options - double reset.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
038 - punctkeys.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
038 - punctkeys.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
039 - generic ctrlalt.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
039 - generic ctrlalt.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
040 - long context.kmn refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00
040 - long context.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
041 - long context and deadkeys.kmn feat(windows): tweak tests after rebase master 2022-01-13 13:59:41 +10:00
041 - long context and deadkeys.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
042 - long context and split deadkeys.kmn refactor(linux): Refactor two core tests 2021-12-03 17:23:36 +01:00
042 - long context and split deadkeys.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
043 - output and keystroke.kmn chore(common): add tests for Keyman Core 2020-05-08 16:53:53 +10:00
043 - output and keystroke.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
044 - if and context.kmn fix(common/core): context mismatch with if and deadkey automatic test 2021-01-18 10:22:59 +11:00
044 - if and context.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
045 - deadkey and context.kmn fix(common/core): context mismatch with if and deadkey automatic test 2021-01-18 10:22:59 +11:00
045 - deadkey and context.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
046 - deadkey and contextex.kmn fix(common/core): context mismatch with if and deadkey automatic test 2021-01-18 10:22:59 +11:00
046 - deadkey and contextex.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
047 - caps always off initially on.kmn feat(common/core): Implement capsAlwaysOff system store 2021-07-23 10:25:28 +02:00
047 - caps always off initially on.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
048 - modifier keys keep context.kmn fix(linux): Address code review comments 2021-08-19 12:15:42 +02:00
048 - modifier keys keep context.kmx feat(windows): revert built kmx files 2022-01-17 11:36:58 +10:00
kmp.json.in chore(common/core): generate kmp.json 2021-10-28 10:47:01 +02:00
kmx.cpp chore(common/core): refactor kmx unit tests 2021-10-29 17:50:56 +02:00
kmx_imsample.kmn feat(windows): fix missing break in action items switch 2022-01-13 13:55:59 +10:00
kmx_imsample.kmx feat(web): &newLayer and &oldLayer 2022-03-13 08:29:15 +11:00
kmx_imx.cpp feat(windows): Check imx_list is allocated before delete 2022-01-20 15:02:35 +10:00
kmx_key_list.cpp feat(windows): add MapUSCharToVK to kmx processor 2021-11-29 10:52:16 +10:00
kmx_key_list.kmn feat(windows): Rename kbd file fix meson build for key list test 2021-11-29 10:52:09 +10:00
kmx_key_list.kmx feat(web): &newLayer and &oldLayer 2022-03-13 08:29:15 +11:00
kmx_test_source.cpp chore(common/core): refactor kmx unit tests 2021-10-29 17:50:56 +02:00
kmx_test_source.hpp chore(common/core): refactor kmx unit tests 2021-10-29 17:50:56 +02:00
meson.build chore(common): remove rust (for now!) 🦀 2022-02-24 17:34:23 -06:00
README.md feat(common/core): Implement capsAlwaysOff system store 2021-07-23 10:25:28 +02:00

KMX unit tests

This directory contains unit tests that test the KMX processing.

The driver (kmx.cpp) loads and executes the tests. Each test consist of a Keyman keyboard source file (0*.kmn) and the compiled KMX keyboard. The source file contains rules and defines the setup, input and expected results.

Defining tests in the .kmn file

The top of the file contains comments that define the setup, input and expected results. Following the comments are the normal rules of a Keyman keyboard.

Setup

  • description: this is just for commenting what we test here
c Description: Tests Caps Lock env set
  • option: allows to put the system in a defined state. The example below sets the platform.
c option: &platform=linux
  • capsLock: allows to set the caps lock state. The example below turns caps-lock on at the start of the test. [K_CAPS] in the keys comment allows toggling of caps lock.
c capsLock: 1
  • context: allows to setup a string which serves as context
c context:

Input

  • keys: defines one or more virtual keys that will be processed one after the other
c keys: [K_1][K_CAPS][K_2][SHIFT K_3][K_4][K_CAPS][K_5][K_CAPS][K_6]

Expected Result

  • expected: the resulting string of processing the input keys. In the example below each key press is expected to output the string 'pass.'.
c expected: pass.pass.pass.pass.pass.pass.

Running the tests

All tests can be run at once with ./build.sh --debug tests.

Alternatively it's possible to run a single test with:

cd common/core/desktop
build/arch/debug/tests/unit/kmx/kmx 'tests/unit/kmx/038 - punctkeys.kmn' 'tests/unit/kmx/038 - punctkeys.kmx'

or shorter:

cd common/core/desktop
build/arch/debug/tests/unit/kmx/kmx 'tests/unit/kmx/038 - punctkeys'.km{n,x}