Commit graph

79 commits

Author SHA1 Message Date
Steven R. Loomis
c40c19db3f feat(core): refactor ldml test 🙀
- rearrange classes so we can get to dynamic subtests
2023-02-16 12:32:57 -06:00
Steven R. Loomis
8ea87aa828 feat(common): ldml: merge keys into key2 🙀 2023-02-16 12:29:19 -06:00
Steven R. Loomis
c191f0a0b5 feat(core): auto generate test json 🙀
- example testdata for k_001_tiny
- meson to generate test json to ./build/arch/release/tests/unit/ldml/keyboards/k_001_tiny-test.json

#7535
2023-02-15 17:58:52 -06:00
Steven R. Loomis
7c02ab85af feat(core): ldml C++ feature support 🙀
- make ldml.cpp print FAILED on failure especially because of https://github.com/microsoft/vscode-cpptools/issues/487
- add vkey validation (#7135)
- add disp validation
- fix: a latent bug in disp! disp.count was === vkey.count, oops. Fix and test cases.

For: #7985
2023-02-14 09:23:03 -06:00
Steven R. Loomis
db272e08e7 Merge remote-tracking branch 'upstream/master' into chore/merge-master-20230210-epic-ldml 2023-02-10 11:01:27 -06:00
Steven R. Loomis
41f77a874c feat(common): ldml different hardware support 🙀
- add HardwareToKeymap in common/web/types
- add a mt-iso keyboard, very close to stock mt.xml
- add machinery for parsing modifier key sequences
- more test machinery
- add assertions against invalid modifier sequences

Fixes: #7965
2023-02-03 19:00:57 -06:00
Steven R. Loomis
af10312f84 feat(common): ldml modifier support 🙀
- spec: update spec for layr.mod field
- core/include/ldm: update constants
- bitfield modelled after s_modifier_names[]  / LCTRLFLAG etc.
- new test case k_004_tinyshift, also update k_010_mt
- update const builder to ignore all *_map properties
- split utility out to utils, add test

For: #7533
(cherry picked from commit 0346bea488)
2023-02-03 18:54:22 -06:00
Eberhard Beilharz
c176ebc6af
chore(linux): Address code review comments 2023-01-31 17:38:29 +01:00
Eberhard Beilharz
eb076c08c8
chore(linux): Build with meson instead of autotools
This change introduces meson for building ibus-keyman instead of
autotools.

Closes #5981.
2023-01-30 16:32:38 +01:00
Steven R. Loomis
3eb7f05df6 feat(developer): ldml implied keys work 🙀
- update test cases per review

- review comment
2023-01-27 12:42:18 -06:00
Steven R. Loomis
0b497be277 chore(core): update tests per merge conflicts 2023-01-27 12:41:47 -06:00
Steven R. Loomis
727056cb87 feat(developer): ldml support implied keys 🙀
- automatically add the import

Fixes: #7964

Apply suggestions from code review

Co-authored-by: Marc Durdin <marc@durdin.net>
2023-01-27 12:41:39 -06:00
Steven R. Loomis
6fd2e418bc feat(common): ldml implement imports 🙀
add tests:
- k_100, k_101, k_102 all failed for different reasons.
- rename test cases from 'fail' to 'keytest' since they don't fail anymore

For: #7401

- update k101_fail.xml / k102_fail.xml to use an implied import
- update build.sh to bring over the imports from CLDR

For #7534
2023-01-27 12:40:22 -06:00
Steven R. Loomis
631cd5007e chore(developer): disable mt 🙀
- disable mt for now, as it will depend on imports

For: #7965
2023-01-26 13:49:49 -06:00
Steven R. Loomis
a1cfd7253d fix(common): update USVirtualKeyMap to actually be US🙀
comon/web/types:
- the USVirtualKeyMap was actually somewhat ISO-ish. Correct it.
- also, add the spacebar row.
- create a new ISOVirtualKeyMap, but not linked in anywhere.

core/tests:
- add a new test keyboard, k_010_mt.xml which is Maltese 47-key
- update k_003 which was impacted by this

For: #7965
2023-01-26 13:49:49 -06:00
Steven R. Loomis
666d71f342 chore(core): ldml: update unit tests 🙀
- add hardware="us"

For: #7986
2023-01-19 21:36:04 -06:00
Steven R. Loomis
e4799d2498
Merge pull request #7956 from keymanapp/fix/core/maqtugha
fix(core): ldml: fix spelling of maqtugħa 🙀
2023-01-07 22:54:48 -06:00
Steven R. Loomis
f7f40a2bb8 fix(core): ldml: fix spelling of maqtugħa 🙀
- maqtua should be maqtugħa (cut) but spelled as maqtugha where used as an NMTOKEN
2022-12-30 17:01:48 -06:00
Steven R. Loomis
b850e3f7d8 chore(core): ldml: fix merge 🙀
- correct merge issue with km_kbp_process_event()

For feat(developer): ldml: include all LDML data in kmx+ 🙀 #7042
2022-12-16 14:07:08 -06:00
Steven R. Loomis
bc14f18460 Merge remote-tracking branch 'origin/master' into chore/core/mergemaster4-epic-ldml 2022-12-15 17:55:13 -06:00
Marc Durdin
42a9f2ca72 fix(core): emit keystroke was writing to wrong queue
Fixes #7649.

emit_keystroke code path in kmx processor was writing directly to the
core queue instead of to the internal kmx processor queue. This caused
it to be out-of-order in the actions sent to the engine/debugger.

Engines didn't really care but it broke the debugger, for example if
only a deadkey was in the buffer and backspace was pressed, Developer
would assert as it would get unexpected context for the deletions.
2022-11-08 16:31:30 +11:00
Marc Durdin
a8c3854431 fix(core): save() should be on internal kmx action queue
Fixes #7643.

The kmn statement `save()` action was being written directly to the
state queue, bypassing the internal kmx action queue. This caused two
issues:

1. save() actions were out-of-order with other actions on the same key
   event.
2. The number of items in the internal action queue became out of sync
   with the debug item queue, which would cause the debugger to fail
   with an assertion.

The new test in debug_api.cpp validates this second issue as the number
of items in the action queue now matches the expected count in the
corresponding debug item.
2022-11-07 10:28:58 +11:00
Steven R. Loomis
85da473a85 chore(developer): update DTD location 🙀
- dtd is in a subdirectory to match CLDR layout
2022-10-18 12:52:27 -05:00
Steven R. Loomis
66a5cdb1f9 chore(developer): ldml: update tools and data for keyboard-preview 🙀
- update tooling in common and kmc
- update spec
- update test files
2022-10-18 11:32:41 -05:00
Steven R. Loomis
fc554c4901 fix(core): xstring/utf32 review feedback
For: #7418

Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2022-10-13 17:05:39 -05:00
Steven R. Loomis
5a6389deb8 feat(core): ldml: basic transforms, again 🙀
- new test file for transforms
- new class, ldml_transforms

for #7234
2022-10-12 19:29:37 -05:00
Steven R. Loomis
8a6b4a7fd4 feat(core): ldml: Use new UTF-16 to UTF-32 function 🙀
- also a test case with a 🙀 key on the tiny keyboard

For #7418
2022-10-12 19:26:42 -05:00
Steven R. Loomis
20032d02b7 feat(core): kmx_xstring: New UTF-16 to UTF-32 function 🙀
- plus test

For #7418
2022-10-12 19:23:58 -05:00
Steven R. Loomis
35799e2306 feat(core): kmx_plus: add accessors for elem 🙀
- other refactor and cleanup in kmx_plus

for #7234
2022-10-11 15:43:44 -05:00
Marc Durdin
003f23d7b4 feat(developer): fixup and prepare build scripts and docs for kmc 2022-09-19 06:36:06 +10:00
Marc Durdin
3e6d9356c3
Merge pull request #7255 from keymanapp/chore/7222-optional-checksum
chore: make checksum optional 🙀
2022-09-13 06:30:04 +10:00
Marc Durdin
31a34f73d7 chore(core): add unit test for zero checksum 2022-09-12 05:46:13 +10:00
Marc Durdin
561899a2a0 refactor(developer): rename kmldmlc to kmc
Fixes #7237.

Full clean, configure and build will be required for Core, Developer
after this change.

kmc is much less unwieldy a name than kmldmlc, and becomes our platform
for future compiler integration. Start of implementation for #5283 also.
2022-09-09 09:13:39 +10:00
Steven R. Loomis
90131728e8 chore(core): improve xstring macros 🙀
- move Utf32CharToUtf16 to inline
- remove Is_SMP and call sites, use Utf32CharToUtf16 instead.

For: #7134
2022-09-08 12:29:04 -05:00
Steven R. Loomis
029a2737bf fix(core): ldml: improve utf-32 handling++ 🙀
- review comments
- kmx_xstring: add and document macros, add Utf32CharToUtf16
- unit tests for kmx_xstring macros

Fixes: #7134
2022-09-08 11:45:23 -05:00
Steven R. Loomis
7a71ed84cc fix(core): ldml: improve utf-32 handling 🙀
- remove hacky utf-32 processing
- add utf-32 test case to test_kmx_plus.cpp
- change kmx_plus to return std::u16string
- kmx_xstring: add Uni_IsBMP() macro

Fixes: #7134
2022-09-07 18:08:26 -05:00
Marc Durdin
d141274aed chore(core): update hextobin files with new format 2022-09-02 14:06:26 +10:00
Marc Durdin
655c872dc8 chore: Merge branch 'master' into chore/merge-master-feature-ldml 2022-08-30 06:31:04 +10:00
Marc Durdin
895ce930a0
Merge pull request #6993 from keymanapp/chore/core/rename-json-source
chore(core): rename json.hpp to jsonpp.hpp 🛩
2022-08-29 14:48:32 -05:00
Marc Durdin
670229937a chore: move hextobin to common 2022-08-29 15:07:43 +10:00
Marc Durdin
3d08348256 feat(core): hextobin tool
The hextobin tool is used to help us construct invalid .kmx files
without having to either hack these into the compiler, or write them
with a hex editor. It feels a little bit of overkill, but this makes it
easy to (a) work with our intended file structures, and (b) review any
changes to these invalid keyboard tests.

Note: I did do a cursory search for a hex2bin or hextobin that we could
easily use but did not find a good simple cross-platform tool that we
could consume (`xxd -r` would work but AFAICT constrains our format to a
dump which is much harder to work with and read -- I wanted to be able
to annotate with file structures.)

For an example, see ik_000_null_invalid.txt.

This means that building the invalid keyboards for tests requires node,
but that should be fine given we need node to build the valid keyboards
anyway.

I've put hextobin under core/tools but it could just as well live under
common/tools in the future, if we find it useful for other project unit
tests.
2022-08-29 06:21:16 +10:00
Marc Durdin
9945055c00 chore(core): move and re-enable invalid ldml keyboard tests 2022-08-28 05:10:21 +10:00
Marc Durdin
bc02ba984a chore(core): skip ldml keyboard tests if node not available 2022-08-27 08:47:34 +10:00
Marc Durdin
3ff5c4c46e chore(core): fix typo 2022-08-26 15:58:25 +10:00
Marc Durdin
a3b1a96960 chore(core): disable failing tests for now 2022-08-26 15:48:19 +10:00
Marc Durdin
daf6a7970e feat(core): use kmldmlc to build test keyboards
Removes .kmx from repo and builds them from the source .xml files using
kmldmlc (building that if necessary also with a poor fella's dependency
check for now), and generally a lot of cleanup of the meson.build files
for the ldml tests.

Moves keyboards to a subfolder of the ldml unit test folder to keep them
neat and tidy and avoid embedding huge files into ldml.js for test of
WASM.

Note: 000_null_keyboard and 002_null_invalid do build successfully, but
the core ldml keyboardprocessor currently fails on them, because they
are missing keys and vkey sections.
2022-08-26 15:12:38 +10:00
Steven R. Loomis
4c5f60ae22
Merge pull request #7125 from keymanapp/feat/core/7043-repadding 2022-08-25 13:54:59 -05:00
Steven R. Loomis
190776ef9c
Update core/tests/unit/ldml/ldml.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-08-25 13:53:35 -05:00
Steven R. Loomis
a809fc86be
Update core/tests/unit/ldml/ldml.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-08-25 13:53:21 -05:00
Steven R. Loomis
af3bcd2a15 feat(core): ldml: padding for vkey and loca 🙀
- vkey and loca needed padding before the variable part
- add static asserts to validate this padding
- update sample files (null and tiny)

#7043
2022-08-25 12:54:52 -05:00