mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-23 14:27:48 +00:00
Fixes a race condition when compiling multiple packages, where the temp path may be re-used before the compiler has finished with it. To take advantage of this fix, I wanted to make sure I was using the right kmcomp.exe when building unit tests for Keyman Core. This uncovered a couple of other things: * Updates Keyman Core build infrastructure to use the current kmcomp.exe rather than a system-installed one. * Corrects a bug that was identified by the 15.0 version of kmcomp in one unit test (duplicate `&NAME` stores -- the meson test script prepends a `&NAME` store to each source file during build). @keymanapp-test-bot skip |
||
|---|---|---|
| .. | ||
| template | ||
| 000 - null keyboard.kmn | ||
| 000 - null keyboard.kmx | ||
| 001 - basic input UnicodeI.kmn | ||
| 001 - basic input UnicodeI.kmx | ||
| 002 - basic input Unicode.kmn | ||
| 002 - basic input Unicode.kmx | ||
| 003 - nul.kmn | ||
| 003 - nul.kmx | ||
| 004 - basic input (shift 2).kmn | ||
| 004 - basic input (shift 2).kmx | ||
| 005 - nul with initial context.kmn | ||
| 005 - nul with initial context.kmx | ||
| 006 - vkey input (shift ctrl).kmn | ||
| 006 - vkey input (shift ctrl).kmx | ||
| 007 - vkey input (ctrl alt).kmn | ||
| 007 - vkey input (ctrl alt).kmx | ||
| 008 - vkey input (ctrl alt 2).kmn | ||
| 008 - vkey input (ctrl alt 2).kmx | ||
| 012 - ralt.kmn | ||
| 012 - ralt.kmx | ||
| 013 - deadkeys.kmn | ||
| 013 - deadkeys.kmx | ||
| 014 - groups and virtual keys.kmn | ||
| 014 - groups and virtual keys.kmx | ||
| 015 - ralt 2.kmn | ||
| 015 - ralt 2.kmx | ||
| 017 - space mnemonic kbd.kmn | ||
| 017 - space mnemonic kbd.kmx | ||
| 018 - nul testing.kmn | ||
| 018 - nul testing.kmx | ||
| 019 - multiple deadkeys.kmn | ||
| 019 - multiple deadkeys.kmx | ||
| 020 - deadkeys and backspace.kmn | ||
| 020 - deadkeys and backspace.kmx | ||
| 021 - options.kmn | ||
| 021 - options.kmx | ||
| 022 - options with preset.kmn | ||
| 022 - options with preset.kmx | ||
| 023 - options with save.kmn | ||
| 023 - options with save.kmx | ||
| 024 - options with save and preset.kmn | ||
| 024 - options with save and preset.kmx | ||
| 025 - options with reset.kmn | ||
| 025 - options with reset.kmx | ||
| 026 - system stores.kmn | ||
| 026 - system stores.kmx | ||
| 027 - system stores 2.kmn | ||
| 027 - system stores 2.kmx | ||
| 028 - smp.kmn | ||
| 028 - smp.kmx | ||
| 029 - beep.kmn | ||
| 029 - beep.kmx | ||
| 030 - multiple groups.kmn | ||
| 030 - multiple groups.kmx | ||
| 031 - caps lock.kmn | ||
| 031 - caps lock.kmx | ||
| 032 - caps control.kmn | ||
| 032 - caps control.kmx | ||
| 033 - caps always off.kmn | ||
| 033 - caps always off.kmx | ||
| 034 - options double set reset.kmn | ||
| 034 - options double set reset.kmx | ||
| 035 - options double set staged.kmn | ||
| 035 - options double set staged.kmx | ||
| 036 - options - double reset staged.kmn | ||
| 036 - options - double reset staged.kmx | ||
| 037 - options - double reset.kmn | ||
| 037 - options - double reset.kmx | ||
| 038 - punctkeys.kmn | ||
| 038 - punctkeys.kmx | ||
| 039 - generic ctrlalt.kmn | ||
| 039 - generic ctrlalt.kmx | ||
| 040 - long context.kmn | ||
| 040 - long context.kmx | ||
| 041 - long context and deadkeys.kmn | ||
| 041 - long context and deadkeys.kmx | ||
| 042 - long context and split deadkeys.kmn | ||
| 042 - long context and split deadkeys.kmx | ||
| 043 - output and keystroke.kmn | ||
| 043 - output and keystroke.kmx | ||
| 044 - if and context.kmn | ||
| 044 - if and context.kmx | ||
| 045 - deadkey and context.kmn | ||
| 045 - deadkey and context.kmx | ||
| 046 - deadkey and contextex.kmn | ||
| 046 - deadkey and contextex.kmx | ||
| 047 - caps always off initially on.kmn | ||
| 047 - caps always off initially on.kmx | ||
| 048 - modifier keys keep context.kmn | ||
| 048 - modifier keys keep context.kmx | ||
| kmp.json.in | ||
| kmx.cpp | ||
| kmx_imsample.kmn | ||
| kmx_imsample.kmx | ||
| kmx_imx.cpp | ||
| kmx_key_list.cpp | ||
| kmx_key_list.kmn | ||
| kmx_key_list.kmx | ||
| kmx_test_source.cpp | ||
| kmx_test_source.hpp | ||
| meson.build | ||
| README.md | ||
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}