spiegel-keyman/developer/src/kmcmplib/tests
Marc Durdin 669ca4b6fd chore(common): remove clearcontext,fix,switch,key statements
Remove compiler support for `clearcontext`, `fix`, `switch` statements
and remove corresponding `CODE_` definitions, as well as `CODE_KEY`,
which was never used.

These four statements have never been documented and have either never
been implemented, or long been unsupported. An earlier change (#16445)
marked `clearcontext` and `fix` as deprecated for v19 onwards, but
deprecation for an undocumented language feature is an unnecessary step,
so have opted to remove altogether in v19 to reduce complexity. This
means that `VERSION_190` is used now only for compile target
deprecations.

Follows: #16445
Test-bot: skip
2026-10-05 08:09:12 +02:00
..
fixtures chore(developer): remove sil_yi from set of keyboard repo tests 2025-09-12 14:35:47 +02:00
api.tests.cpp fix(developer): handle leading whitespace correctly in u16tok() 2026-08-27 11:15:14 +02:00
get-test-source.sh fix(developer): emit compile error when unsupported statements encountered in stores 2026-10-03 11:41:42 +02:00
gtest-compiler.tests.cpp chore(common): remove clearcontext,fix,switch,key statements 2026-10-05 08:09:12 +02:00
gtest-km_u16.tests.cpp fix(developer): handle leading whitespace correctly in u16tok() 2026-08-27 11:15:14 +02:00
gtest-validation.tests.cpp fix(developer): restrict invalid characters in identifiers in kmcmplib 2025-09-12 10:52:31 +02:00
keyboards_commit_ref.txt chore(developer): fixup tests and build process 2023-03-17 04:31:03 +07:00
kmcompx.tests.cpp chore(developer): rename test files 2024-11-28 14:32:09 +01:00
meson.build test(common): add new baseline test k_0202___alt.kmn 2025-12-16 16:52:13 +01:00
prep.sh maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
README.md chore(developer): only run keyboards-repo tests for a full-test 2023-04-20 12:59:00 +07:00
run-shell.bat chore(developer): fixup tests and build process 2023-03-17 04:31:03 +07:00
uset-api.tests.cpp chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-12-01 16:17:21 +07:00
util_callbacks.cpp fix(developer): normalize path separators in unit tests in kmcmplib 2024-11-06 12:57:55 +07:00
util_callbacks.h refactor(developer): improve the callbacks for kmcmplib 2024-07-26 15:55:44 +07:00
util_filesystem.cpp fix(core): rename assert() to test_assert() in unit tests 2024-11-28 09:46:01 +07:00
util_filesystem.h refactor: move kmx_u16 to common and rename to km_u16 2024-08-14 10:07:08 +02:00

Unit tests for kmcmplib

Note: the keyboards repository tests only run if --full-test is passed to build.sh.

kmcmplib tests include building all keyboards in the keyboards repository and comparing against a 'known good' legacy compiler set. This is trickier than it sounds because the legacy compiler only runs under Windows/WINE and we don't want to introduce a dependency on that for running the tests.

Instead we've gone the route of adding a pre-compiled set of .kmx fixtures, alongside a commit ref in keyboards_commit_ref.txt. The test script will checkout that specific ref in its own private clone of the keyboards repository (including a shallow clone of the keyboards repo if it isn't already present), and compiling the sources from that specific commit.

For performance reasons, it is useful to setup KEYBOARDS_ROOT env var to point to your local clone of the keyboards repository. The build will make a private clone of this repo rather than the remote clone if it is available, which is typically much faster.

Preparing fixtures

prep.sh allows us to regenerate the fixtures with the legacy compiler for testing. It depends on the regression test scripts in keyboards.sh, and specific changes introduced into those scripts in https://github.com/keymanapp/keyboards/pull/2169.

It is essential that the keyboards repository is clean and checked out to the commit that you want to be using (usually this will be HEAD of master). All of Keyman Developer must be built locally and binaries should be in developer/bin/.

prep.sh has only been tested on Windows, because it relies on kmcomp.exe.