spiegel-keyman/core/tests/unit/kmx
2023-01-31 17:38:29 +01:00
..
template chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
000 - null keyboard.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
000 - null keyboard.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
001 - basic input UnicodeI.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
001 - basic input UnicodeI.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
002 - basic input Unicode.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
002 - basic input Unicode.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
003 - nul.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
003 - nul.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
004 - basic input (shift 2).kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
004 - basic input (shift 2).kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
005 - nul with initial context.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
005 - nul with initial context.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
006 - vkey input (shift ctrl).kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
006 - vkey input (shift ctrl).kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
007 - vkey input (ctrl alt).kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
007 - vkey input (ctrl alt).kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
008 - vkey input (ctrl alt 2).kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
008 - vkey input (ctrl alt 2).kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
012 - ralt.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
012 - ralt.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
013 - deadkeys.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
013 - deadkeys.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
014 - groups and virtual keys.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
014 - groups and virtual keys.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
015 - ralt 2.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
015 - ralt 2.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
017 - space mnemonic kbd.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
017 - space mnemonic kbd.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
018 - nul testing.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
018 - nul testing.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
019 - multiple deadkeys.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
019 - multiple deadkeys.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
020 - deadkeys and backspace.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
020 - deadkeys and backspace.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
021 - options.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
021 - options.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
022 - options with preset.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
022 - options with preset.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
023 - options with save.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
023 - options with save.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
024 - options with save and preset.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
024 - options with save and preset.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
025 - options with reset.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
025 - options with reset.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
026 - system stores.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
026 - system stores.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
027 - system stores 2.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
027 - system stores 2.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
028 - smp.kmn chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
028 - smp.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
029 - beep.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
029 - beep.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
030 - multiple groups.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
030 - multiple groups.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
031 - caps lock.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
031 - caps lock.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
032 - caps control.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
032 - caps control.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
033 - caps always off.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
033 - caps always off.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
034 - options double set reset.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
034 - options double set reset.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
035 - options double set staged.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
035 - options double set staged.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
036 - options - double reset staged.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
036 - options - double reset staged.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
037 - options - double reset.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
037 - options - double reset.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
038 - punctkeys.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
038 - punctkeys.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
039 - generic ctrlalt.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
039 - generic ctrlalt.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
040 - long context.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
040 - long context.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
041 - long context and deadkeys.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
041 - long context and deadkeys.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
042 - long context and split deadkeys.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
042 - long context and split deadkeys.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
043 - output and keystroke.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
043 - output and keystroke.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
044 - if and context.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
044 - if and context.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
045 - deadkey and context.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
045 - deadkey and context.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
046 - deadkey and contextex.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
046 - deadkey and contextex.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
047 - caps always off initially on.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
047 - caps always off initially on.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
048 - modifier keys keep context.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
048 - modifier keys keep context.kmx chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
kmp.json.in chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
kmx.cpp chore(common): Merge branch 'chore/web/keyman-version-for-developer' into chore/common/move-common-core-desktop-to-core 2022-05-30 09:38:27 +10:00
kmx_imsample.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
kmx_imsample.kmx chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
kmx_imx.cpp chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
kmx_key_list.cpp chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
kmx_key_list.kmn chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
kmx_key_list.kmx chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
kmx_test_source.cpp chore(common): Merge branch 'chore/web/keyman-version-for-developer' into chore/common/move-common-core-desktop-to-core 2022-05-30 09:38:27 +10:00
kmx_test_source.hpp chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
meson.build chore(linux): Address code review comments 2023-01-31 17:38:29 +01:00
README.md chore(common): adjust scripts for core relocation 2022-05-18 07:22:11 +10: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 core
build/arch/debug/tests/unit/kmx/kmx 'tests/unit/kmx/038 - punctkeys.kmn' 'tests/unit/kmx/038 - punctkeys.kmx'

or shorter:

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