Commit graph

390 commits

Author SHA1 Message Date
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
Steven R. Loomis
f7aeba5f01 feat(core): ldml: validator for kmxplus 🙀
- also update test case, 002_null_invalid is expected to not validate

#7097
2022-08-25 12:54:08 -05:00
Steven R. Loomis
43b3e3243e fix(core): ldml: emit nothing (no err) on unassigned keys 🙀
- also update test case

#7097
2022-08-25 11:22:19 -05:00
Steven R. Loomis
7aac6a1747 chore(core): update 000_null_keyboard to be a proper null keyboard 🙀
- rewrite 000_null_keyboard.kmx to be valid, but with no keys
- remove outdated comment in kmx_plus.h
- update kmx_plus.cpp to not reverse the order of section ids (#7098)
- add a new test option for expected-error
2022-08-24 17:04:55 -05:00
Steven R. Loomis
b180ca844d fix(core): fixes for kmx_file rearrangement 🙀
fix breaks in #7111 and prior

#7098
2022-08-24 13:49:55 -05:00
Marc Durdin
fa28040643
Merge pull request #7100 from keymanapp/fix/core/7098-cxxfun
fix(core): ldml: remove 0-length arrays 🙀
2022-08-23 23:20:14 -05:00
Marc Durdin
e6ff47f2b3 chore: Merge branch 'master' into feature-ldml 2022-08-24 04:21:21 +10:00
Steven R. Loomis
fd4945c5ee fix(core): ldml: goodbye multichar strings 🙀
- use 32 bit hex constants instead

#7098
2022-08-23 11:27:59 -05:00
Steven R. Loomis
a333eade22 feat(core): ldml: tiny passes tests
- removed null from build, invalid
2022-08-18 14:27:17 -05:00
Steven R. Loomis
70639c585b feat(core): more kmx_plus_dump functions
- also update sample data again
2022-08-17 18:13:17 -05:00
Steven R. Loomis
5926dfe5fe feat(core): more kmx_plus_dump functions
- also update sample data
2022-08-17 17:43:14 -05:00
Steven R. Loomis
95b4469ea8 feat(core): build out ldml structures
- checkin spec to repo
- new header: kmx_plus.h with data access structs and functions
- static asserts to validate header sizes
- early validation of data
- internal dump of kmx+ data
2022-08-17 15:53:53 -05:00
Steven R. Loomis
615eec89ca feat(core): augment unit tests for ldml
- add 001_tiny to the build, annotate with expected run
2022-08-17 13:31:09 -05:00
Steven R. Loomis
9e44a7f9bc feat(core): Sample LDML data updates, kmx_file #5015
Review comments:
- moved KMXPLUSINFO into separate struct
- created resource/standards-data/ldml-keyboards for CLDR data
- corrected Khmer err
2022-08-16 10:24:53 -05:00
Steven R. Loomis
29d4cc0354 test(core): add sample tiny file
- also snapshot dtd
2022-08-16 10:24:53 -05:00
Steven R. Loomis
e8dff5cf4e feat(core): add event_flags to process_event #7046
- use a constant, KM_KBP_EVENT_FLAG_DEFAULT for 0
- update pascal and python
- update linux and windows
2022-08-12 09:58:58 -05:00
Steven R. Loomis
21a783a6ca feat(core): add event_flags to process_event
- uint16_t
- defined km_kbp_event_flags to define the bitfield
- bitfield has value KM_KBP_EVENT_FLAG_TOUCH for touch events
- ignored everywhere, currently
2022-08-11 16:14:57 -05:00
Marc Durdin
8e36b33f21 chore(common): check for redefinition of defines 2022-08-11 16:29:02 +02:00
Marc Durdin
515bda7692 chore(linux): ensure char16_t and namespace 2022-08-11 16:13:33 +02:00
Marc Durdin
422e7227a6 chore(core): move kmx_file.h to common 2022-08-11 11:34:09 +02:00
Marc Durdin
7ff9e79e01 feat(core): ldml unit tests and stub actions
* Enables identification of KMXPlus files in processor factory
* Adds a stub action to generate an 'a' output character
* Adds a passing null_keyboard unit test for a hypothetical ldml
  keyboard
2022-08-07 08:02:50 -05:00
Marc Durdin
e0d7fc73fc chore(core): tweak test path for native build unit tests 2022-08-01 14:47:44 +10:00
Marc Durdin
f762776d5c chore(core): get wasm core building again
Updates search for emscripten if not on path, and fixes up unit test
infrastructure for wasm builds for new tests.
2022-08-01 14:15:52 +10:00
Marc Durdin
b5bddc025f chore(core): rename json.hpp to jsonpp.hpp
The name json.hpp conflicts with the JSON for Modern C++ library that
is also used by Developer. Renames json.hpp and json.cpp to jsonpp.hpp
and jsonpp.cpp aka "JSON Pretty Printer".
2022-07-26 13:06:16 +10:00
Marc Durdin
4f36c3c2df chore(developer): Merge branch 'master' into chore/developer/js-to-lmc 2022-06-25 05:48:57 +10:00
Marc Durdin
7895cf2382 chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
Eberhard Beilharz
f2de89bcc2
chore(common): Merge branch 'master' into chore/common/move-common-core-desktop-to-core 2022-06-15 09:00:32 +02:00
Marc Durdin
d5aa61fdc0 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
Marc Durdin
4ab3c53810 chore(common): adjust scripts for core relocation 2022-05-18 07:22:11 +10:00
Marc Durdin
a58680f89b chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00