spiegel-keyman/developer/src/kmcmplib/tests
2024-09-30 11:45:57 +01:00
..
fixtures chore: use kmc instead of kmcomp to build test keyboards 2023-09-16 15:24:46 +07:00
api-test.cpp refactor(developer): move error reporting inside GetCompileTargetsFromTargetsStore 2024-07-29 10:52:23 +07:00
get-test-source.sh chore(developer): final cleanup 2023-03-17 05:38:03 +07:00
gtest-compiler-test.cpp chore(developer): add initFileStoreArray() and use it in GetXStringImpl_type_i test 2024-09-30 11:45:57 +01:00
gtest-km_u16-test.cpp fix(developer): adjust comments for alignment 2024-09-10 12:09:50 +01:00
keyboards_commit_ref.txt chore(developer): fixup tests and build process 2023-03-17 04:31:03 +07:00
kmcompxtest.cpp refactor(developer): align kmcmplib error codes with kmc 2024-07-28 11:45:03 +07:00
meson.build refactor: move kmx_u16 to common and rename to km_u16 2024-08-14 10:07:08 +02:00
prep.sh chore(developer): move keyboard repo fixtures 2023-05-30 13:08:53 +07: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-test.cpp feat(common): preflighting on uset 🙀 2023-07-03 18:48:48 -05:00
util_callbacks.cpp refactor(developer): move kmcmplib message construction to kmc-kmn 2024-07-30 10:01:19 +07:00
util_callbacks.h refactor(developer): improve the callbacks for kmcmplib 2024-07-26 15:55:44 +07:00
util_filesystem.cpp refactor(developer): remove unnecessary includes from kmx_u16 2024-08-14 09:50:11 +02: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.