Commit graph

72 commits

Author SHA1 Message Date
Marc Durdin
457275e46f fix(developer): ensure fatal errors report message or made non-fatal
Fixes #10678.

Some messages have been reduced to ERROR instead of FATAL, as they are
not internal compiler errors.

Where fatal messages are raised, the message will now be reported
through correctly to Sentry.
2024-02-20 11:10:39 +07:00
rc-swag
2f737981f7 fix(core): add expected_context to keyboard unit tests
The unit tests needed to be updated to handle the cases
where the context is invalidated by a keystroke. However, they
still need to be able to verify the final string the application
should recieve. To do this a expected context token has been added
to the unit test format.
2023-12-15 11:20:08 +10:00
rc-swag
8e20fcf6b2 fix(core): missed checking in baseline.kpj 2023-12-14 14:20:05 +10:00
rc-swag
437f938368 fix(core): fix baseline test cases k_000 and k_0008
Test k_000___null_keyboard has been updated as the [RALT K_B] should
cause the context to be reset.

Test k_008___vkey_input__ctrl_alt_2_ has been updated as the [LCTRL LALT
K_B] does not match a keyboard rule the context is deemed invalid and should be
reset.

It could be a consideration to modify the text_store object to better
reflect the state of a applications context however this would mean
we would need two expected results one for the application and one
for the context
2023-12-14 12:25:32 +10:00
rc-swag
4a511bde1e fix(core): clear core context on invalidate cache 2023-12-12 23:49:04 +10:00
Eberhard Beilharz
f56033f537 chore(web): Add TAB output to test keyboard 2023-11-23 18:02:36 +01:00
Eberhard Beilharz
ef8b9888c8 chore(web): Update touch layout 2023-11-23 17:22:24 +01:00
Eberhard Beilharz
fb7c19fee4
chore(core): Add test keyboard for text selection tests
Part of #9073.
2023-11-23 10:51:59 +01:00
Eberhard Beilharz
46cdd07e22
fix(linux): Fix baseline tests
Change the test to use characters in the context that don't appear in
the keyboard.
2023-11-08 12:13:56 +07:00
Eberhard Beilharz
fde460ecea chore(core): Recompile keyboard with kmcomp 2023-11-07 05:02:30 +01:00
Eberhard Beilharz
eb64ca4d01
chore(core): Fix test keyboard 2023-11-07 08:29:45 +07:00
Eberhard Beilharz
09843634bb
chore(web): Address code review comments 2023-11-06 17:28:25 +07:00
Eberhard Beilharz
4851c547a9
chore(core): Enhance core test 2023-11-06 15:57:07 +07:00
Eberhard Beilharz
2e71ec9e70
chore(web): Add failing test for deadkey bug
Also adds a similar testcase to the baseline keyboard tests.
2023-11-06 13:28:49 +07:00
Eberhard Beilharz
fa0b3e839e
refactor(core): Remove obsolete comments
Since things are working in both cases it seems that the problem got
fixed and the comments are obsolete.
2023-11-06 12:20:56 +07:00
Marc Durdin
236b1ebc54 fix(developer): enable and update unit tests
Several unit tests were not running as they were not referenced in
developer/src/test/auto/Makefile. This meant that some tests were
outdated:

* two keyboard fixtures needed recompiling with kmcomp in order to match
* some interfaces had changed slightly, necessitating updates to
  corresponding unit tests.
2023-10-31 13:50:34 +07:00
Marc Durdin
a093507a4c chore(developer): remove .keyboard_info sources
Fixes #9551.

Removes various .keyboard_info files from test fixtures and also removes
generation of .keyboard_info source files from kmconvert, alongside now-
redundant tests (cvt.dpr).
2023-09-25 12:19:26 +07:00
Marc Durdin
7f3d7ce17d chore: fixup targets for build_index 2023-09-16 15:46:37 +07:00
Marc Durdin
f140b5e18d chore: convert keyboards build.sh to builder script 2023-09-16 15:41:07 +07:00
Marc Durdin
454448bc63 chore: use kmc instead of kmcomp to build test keyboards 2023-09-16 15:24:46 +07:00
Marc Durdin
3a2540b077 feat(developer): remove kmcomp
Removes kmcomp.dpr, related source, compilekeymanweb.pas, and related
unit tests.

Cleans up a couple of bits and pieces around kmc in order to help tests
to pass, and updates some tests that had legacy code in them
(particularly missing &TARGETS stores).
2023-09-09 17:47:15 +02:00
Marc Durdin
d1d6dc5d99 refactor(developer): compiler interface part 1 for wasm
This starts the refactor of the .kmn compiler interfaces for WASM,
moving more file writes into typescript and out of the compiler. Adds a
cleaner binding and structures for passing compile metadata back to
typescript for additional build steps (e.g. kvk, js builds).

Will rebase the Typescript-based KMW compiler onto this so it can start
to benefit from the refactoring.

* Fixes a minor issue with loading a .kvks file with an empty flags set.
* Adds a writeFileSync method to the compiler callback interfaces.
* Adds an e2e compiler test to verify that .kmx and .kvk are both
  correctly compiled.
2023-05-23 15:26:28 +07:00
Eberhard Beilharz
a7630a0265
fix(linux): Fix linux tests 2023-05-05 10:55:45 +02:00
Darcy Wong
a3e685d12a chore(common): Rename folder 2023-04-25 09:51:03 +07:00
Darcy Wong
64c6bfbbe9 chore(common): Ignore build/ folders 2023-04-25 09:10:30 +07:00
Darcy Wong
3d221381fe chore(common): Skip issue folder 2023-04-25 07:33:41 +07:00
Darcy Wong
91c9cbf61d chore(common): Skip issue folder 2023-04-25 07:18:23 +07:00
Darcy Wong
aa218d4896 chore(common): cd to $THIS_DIR 2023-04-25 07:09:28 +07:00
Darcy Wong
92670f4100 chore(common): Fix issue number 2023-04-24 15:30:41 +07:00
Darcy Wong
f216673f54 chore(common): Update path 2023-04-24 15:09:00 +07:00
Darcy Wong
23f1e79d2f chore(common): Move the_99 test keyboard to issue folder 2023-04-24 15:06:53 +07:00
Marc Durdin
3468a36100 chore(common): add baseline.kpj
This makes it possible to run the common/test/keyboards build.sh and
makes all the baseline keyboards available as a build artifact (but
currently only in .kmx, not .kmp; this may come as a future update.)
2023-03-28 06:50:00 +07:00
Marc Durdin
c18ef54029 refactor(common): move core baseline tests into common
Decided to use the name `baseline` for this set of tests. They can be
used by any project in the repo now. Tests will be treated as shared,
and not modified (except in the case of a buggy test).

* Moves .kmn files, add `&NAME` line (don't use meson templating for
  these files)
* Generates reference .kmx files using kmcomp for use as a baseline with
  kmcmplib (kmc) tests, and for linux tests
* Updates references in core, kmcmplib, and linux builds
* Renames all the .kmn / .kmx to use a standardized, clean name format
  (this was needed for building packages in the core tests)
2023-03-28 05:20:45 +07:00
Marc Durdin
0c07a6d7a3 chore(developer): Merge branch 'feature-kmcompx' into chore/developer/master-to-kmcompx-A17S7 2023-03-02 12:37:37 +07:00
SabineSIL
048448a2a4
feat(developer): cross-platform kmx compiler 🚑 (#6980)
* get keymans version



Merge branch 'master' of https://github.com/keymanapp/keyman into refactor/developer/6026-kmcompx-compiler-cross-platform-part-2-NEW_VERSION

# Conflicts:
#	common/core/desktop/src/kmx/kmx_context.h
#	common/core/desktop/src/kmx/kmx_processor.cpp
#	common/windows/cpp/include/keymanversion.h
#	common/windows/cpp/include/kkmnkbd/Compfile.h
#	common/windows/cpp/include/kmtip_guids.h
#	common/windows/cpp/src/kmtip_guids.cpp
#	core/src/kmx/kmx_conversion.cpp
#	core/src/kmx/kmx_conversion.h
#	core/src/kmx/kmx_file.cpp
#	core/src/kmx/kmx_processevent.cpp
#	core/src/kmx/kmx_processor.hpp
#	core/src/kmx/kmx_xstring.cpp
#	developer/js/.gitignore
#	developer/js/package-lock.json
#	developer/js/tests/tsconfig.json
#	developer/src/kmcmpdll/CasedKeys.cpp
#	developer/src/kmcmpdll/CheckFilenameConsistency.cpp
#	developer/src/kmcmpdll/CheckFilenameConsistency.h
#	developer/src/kmcmpdll/CheckForDuplicates.cpp
#	developer/src/kmcmpdll/CheckForDuplicates.h
#	developer/src/kmcmpdll/CheckNCapsConsistency.cpp
#	developer/src/kmcmpdll/CheckNCapsConsistency.h
#	developer/src/kmcmpdll/Compiler.cpp
#	developer/src/kmcmpdll/DeprecationChecks.cpp
#	developer/src/kmcmpdll/NamedCodeConstants.cpp
#	developer/src/kmcmpdll/UnreachableRules.cpp
#	developer/src/kmcmpdll/UnreachableRules.h
#	developer/src/kmcmpdll/compfile.h
#	developer/src/kmcmpdll/kcframe/kcframe.cpp
#	developer/src/kmcmpdll/kcframe/kcframe.vcxproj
#	developer/src/kmcmpdll/kcframe/kcframe.vcxproj.filters
#	developer/src/kmcmpdll/kmcmpdll.vcxproj
#	developer/src/kmcmpdll/kmcmpdll.vcxproj.filters
#	developer/src/kmcmpdll/version.rc
#	developer/src/kmcmpdll/versioning.cpp
#	developer/src/kmlmc/bundle.sh
#	developer/src/kmlmc/tests/test-join-word-breaker.ts
#	developer/src/kmlmc/tests/test-override-script-defaults.ts
#	developer/src/server/tsconfig.json
#	windows/src/developer/kmcmpdll/Makefile
#	windows/src/developer/kmcmpdll/vkeys.h
#	windows/src/engine/keyman32/keymanengine.h
#	windows/src/global/inc/Vkeys.h
#	windows/src/global/inc/rc4.h
#	windows/src/global/vc/rc4.cpp

* changes in meson + include-paths of several files

* chore: remove common/core

* chore: remove unnecessary files

* chore: move headers and refs

* refactor(developer): fixup path to tests

* refactor(developer): fixup path to tests
tidied up +removed unnecessary files
checked contents of files+included a few new functions needed for myVersion
changed datatypes in CheckForDuplicates
tidy up more paths
CheckFileConsistency: not able to fully adapt for use of char16_t on non windows p.
	-> used char16_t + commented out some AddWarning().

* sorted out some #includes
renamed some functions to reduce ambiguity

* fix(developer): solved linker errors

* chore(developer): remove some comments

* chore(developer): introduced KMX_UCHAR

* chore(developer): restored whitespace, comments

* chore(developer): tidied up vkeys.H / .cpp

* chore(developer): remove keyboardprocessor...

* chore(common): refactor shared types into km_types.h

* chore(core): remove duplicate types

* chore(core): move kmx_file.h to common

* chore(developper): removed typedefs of kmcompcx.h

* chore(developer): removed kmcompx/include/kmx_file.h

* chore(developer): chanched include of pch.h

* chore(developer): removed files from kmcompx/include/

* chore(developer): removed commented sections ( ** old **) if files

* chore(developer): removed doubled/overwritten functions

* chore(developer): removed doubled/overwritten functions

* chore(developer): changed #includes ".." -> <..>

* chore(developer): changed #includes ".." -> <..>

* chore(developer): enable tests for keyboards repo for kmcompx

* chore(developer): new functions e.g. string_from_wstring...

* chore(developer): changed printf->u16sprintf

* chore(developer): fopen

* chore(developer): fixed errors on running kmcompxtest

* chore(developer): changef u16fmt

* chore(developer): fixup u16ncat

* chore(developer): added return Msgs for different types of errors while compiling

* chore(developer): tests using RTL run Ok ( changed RTu->RTL)

* chore(developer): replaced u16ncmp with u16nicmp at most places

* chore(developer): changed Version number for tests 16.046 to 15.0265

* chore(developer): mostly whitespace changes

* chore(developer): tidied up code (not finished yet)

* chore(developer): removed #pragma once from wrong places, edited #includes

* chore(developer): removed #pragma once from wrong places, edited #includes

* chore(developer): CheckFileNameConsistency changed to take KMX_WCHART const* (= wchar_t* const); used in compiler.cpp now

* chore(developer): excluded some tests from kmcompxtest (use get_test_source_exclude_some_kmn.bat now)

* chore(developer): Win-functions in FileNameConsistency

* chore(developer): Win-functions in FileNameConsistency

* chore(developer): CheckFNConsuistency: called u16printf with f´different par.

* chore(developer): tidied up code

* chore(developer): tidied up code

* chore(developer): tiedied up code (compiler.cpp)

* chore(developer): tiedied up code

* chore(developer): tidied up code

* chore(developer): removed all commentaries _S2

* chore(developer): tidied up code

* chore(developer): tidied up code

* chore(developer): tidied up code

* chore(developer): removed several Windows-specific functions

* chore(developer): removed unused datatype typedefs

* chore(developer): new GetCompilerErrorString() used in AddCompileMessage()

* chore(developer): new GetCompilerErrorString() used in AddCompileMessage()

* chore(developer): removed CWARN/CHINT out of CompMsg

* chore(developer): adapted kmcompxtest to test kmn-files that have errors included

* chore(developer): changed gitignore

* chore(developer): changed gitignore

* chore(developer): changed Version Number fot Tests 15.0.265.0 -> 15.0.270.0

* chore(developer): added tests for kmcompx

* chore(developer): move tests (for ErrorMessages) to common/test/keyboards

* chore(developer): move CERR-tests into test/keyboards/invalid

* chore(developer): change mostly whitespace changes

* chore(developer): change mostly whitespace changes

* chore(developer): delete files of keyboards/kmcompx_tests

* chore(developer): include check for correct Filename + rename var + change whitespace changes

* chore(developer): revert changes in AddCompileMessage, tidy up CreateTempFile

* chore(developer): remove python from meson.build

* chore(developer): change ErrExtra, change CompileMsg, change _finddata in FileExists

* chore(developer): check for '_' after Errornumber in Filename

* chore(developer): re-include AddCompilerVersionStore in Compiler.cpp

* chore(developer): add Message CERR_InvalidCharacter to UTF16TempFromUTF8() ; change #include <> -> ""

* chore(developer): add some more keyboardtests

* chore(developer): add some more keyboardtests

* chore(developer): change remaining old datatype-names to new names ( e.g. char -> KMX_CHAR )

* chore(developer): edit + add CERR_tests

* chore(developer): edit + add CERR_tests

* chore(developer): use char16_t in CheckFileNameConsistency

* chore(developer): comments: converting functions in kmx_u16

* chore: reorganize

* chore: commit kmcompx-files

* chore: use ifdef for vkeys

* chore: copy files back

* chore: more cleanup

* chore: meson build for kmcmplib

* chore: tweak unit test, error messages, and paths

* chore(developer): make kmcmplib a static library

* chore(developer): start kmcmpdll link to kmcmplib

* chore(developer): add build.sh for kmcmplib

* chore(developer): link kmcmpdll to kmcmplib

* chore(common): avoid building 'invalid' shared keyboards

* chore(developer): include BEGIN_LINE (repeated Begin)

* chore(developer): add more CERR_tests and move some to other folder, edit readme

* chore(developer): addCompilerMsg for RepeatedBegin

* chore(developer):repeatedBEgin plus rename functions to prevent same names in kmcmpdll and kmcmplib

* chore(developer): add flag flag_use_kmcompx as switch to use old code (kmcmpdll) or new code kmcmplib

* chore(developer): introduce namespace kmcmp instead of different filenames

* chore(developer): more changes for using namespaces

* chore(developer): solve merge conflicts in namespaces

* chore(developer): use namespaces in kmcmplib (except for in dllexport-functions)

* chore(developer): remove some unnecessary CERR_ tests

* chore(developer): remove CERR_CallIsProfessionalFeature, CERR_IncludeCodesIsProfessionalFeature, CERR_MnemonicLayoutIsProfessionalFeature

* chore(developer): note about func.call_js; change all "VESION x.y " to "VESION x.y or higher" ; rename flag for kmcompx to flag_use_new_kmcomp

* chore(developer): use PKMX_DWORD/PKMX_WCHAR   instead of LPKMX_DWORD/LPKMX_WCHAR; use PKMX_STR instead of char* in CompilerMessageProc

* chore(developer): remove kmx-file; NamedCodeConstants: rename variables, set const variables for buf sizes, brackets in for-loops

* chore(developer): change include paths ../

* chore(developer): get rid of reopened namespaces of kmcmp

* chore(developer): restored kmcompxtest

* chore(developer): change #include paths ../ ; excange km_kbp_cp with KMX_WCHAR; change some variable names

* chore(developer): use environment var KEYMAN_ROOT in path for tests; remove try-catch from json-validation.cpp

* chore(developer): use environment var KEYMAN_ROOT in path for tests; remove try-catch from json-validation.cpp

* chore(developer): revert change in NamedCodeConstants

* chore(developer): restored kmcompxtest, adapted readme

* chore(developer): use res-fils/version.rc for kmcmplib

* chore(developer): rename some functions/variables

* chore(developer): typos, comments, add function u16rchr()

* chore(developer): typos, comments, add function u16rchr()

* chore(developer): rename Functions, version rc-files

* chore(developer): rename Functions, version rc-files, set flag_use_new_kmcomp to use (old) kmcmpdll

* chore(developer): add BeginLine in kmcmpdll/Compiler.cpp; fread() in kmcmp_CompileKeyboardFileToBuffer

* chore(developer): set flag_use_new_kmcomp to only use kmcmpdll

* chore(developer): set flag_use_new_kmcomp to only use kmcmpdll...and back to kmcmplib

* (chore(developer): set flag_use_new_kmcomp to only use kmcmpdll...and back

* (chore(developer): changes in NamedCodeConstants::reindex() to run hieroglyphic.kmn properly

* chore(developer): changes in UnrechableRules::VerifyUnreachableRules() to run test_6440_unreachable_code..kmn

* chore(developer): remove unneccessary files, get ErrorMsg for INCLUDECODES, VISUALKEYBOARD, UnreachableRules, ErrExrta

* chore(developer): remove unneccessary files, get ErrorMsg for INCLUDECODES, VISUALKEYBOARD, UnreachableRules, ErrExrta, CWARN_ OK

* chore(developer): after stash:remove unneccessary files, get ErrorMsg for INCLUDECODES, VISUALKEYBOARD, UnreachableRules, ErrExrta, CWARN_ OK

* chore(developer): replace some #include <> with "" ; rename ErrExtra -> ErrExtraW

* chore(developer): replace some #include <> with "" ; rename ErrExtra -> ErrExtraW

* chore(developer): new converting function convert_pchar16T_To_pwcharT in kmx_u16

* chore(developer): CheckFilenameConsistency added fclose()

* chore(developer): --

* chore(developer): removed printf (---> started in... / °°-> changed to...)

* chore(developer): AddDeprecatedCode to get CWARN when in kmcomp.exe -s-w is set

* chore(developer): change MakeHashKeyFromFileKey16() to get correct behaviour of CHINT

* chore(developer): change MakeHashKeyFromFileKey16() to get correct behaviour of CHINT

* chore(developer): move converting function to kmx_u16

* chore(developer): add more CERR_ tests

* chore(developer): Not ready yet: changes in CheckFilenameConsistency to use on non-windows

* chore(developer): Not ready yet: changes in CheckFilenameConsistency to use on non-windows

* chore(developer): copied contents of 3 files of commit fcfc6c698a to here to achieve state of fcfc6c698a

* chore(developer): copied contents of 3 files of commit fcfc6c698a to here to achieve state of fcfc6c698a

* chore(developer): move/rename converting functions

* chore(developer) : update .gitignore, remove converting function

* chore(developer) : update gitignore; sort code in CheckFilenameConsistency::CheckFilenameConsistency()

* chore(developer) : change Version number 15.0.270 -> 17.0.51

* chore(developer): change #includes, path in meson.build

* chore(developer): new function Open_File() to open files on windows and non-windows platforms

* chore(developer): create Function to replace fopen/_wfsopen

* chore(developer): exclude kmx, kvk from git

* chore(developer): exclude kmx, kvk from git

* chore(developer): change #includes to include from kmcmplib

* chore(developer): remove stray fopen

* chore(developer): include Open_File() (as comment for now)

* chore(developer): include Open_File() (as comment for now)

* chore(developer): remove path to kmcmpdll in include_directories

* chore(developer): use functin Open_File()

* chore(developer): remove #ifdef for '\\' and '/' in both IsRelativePath; remove Function Open_File again

* chore(developer): new fun  u16rchr_LinWin, strrchr_LinWin to exchange #ifndef for '\\' and '/'

* chore(developer): implement u16rchr_LinWin and strrchr_LinWin

* chore(developer): implement Open_File()

* chore(developer): new MakeHashKeyFromFileKey, remove comments for Open_File, & *LinWin-functions, delete 1 converting function

* chore(developer): tidy up comments

---------

Co-authored-by: Marc Durdin <marc@durdin.net>
2023-03-01 20:00:04 +11:00
Marc Durdin
ce864ea923 chore: update standard script prolog to use builtin instead of dirname 2023-02-22 11:04:15 +07:00
Marc Durdin
463c7ff907 chore: remove greadlink from standard script prolog 2023-02-22 10:43:06 +07:00
Marc Durdin
a004978863 chore: use builder_heading, remove echo_heading 2023-02-20 09:17:51 +07: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
91b5f2e640 chore(developer): fixup kmcomp ref in keyboards build 2022-05-23 13:58:53 +10:00
Joshua A. Horton
53cd3b1b71 change(web): re-renaming the test kbd 2022-04-13 18:32:10 -05:00
Joshua A. Horton
f16f1185de fix(web): kmn typo 2022-04-12 16:31:47 -05:00
Joshua A. Horton
5e52ed4d2d change(web): renamed+moved 'vowel hater' test kbd 2022-04-12 08:30:09 -05:00
Darcy Wong
b9f6ac34e2 test(common/resources): Add Noto font to web_context_tests keyboard 2022-04-07 08:04:42 +07:00
Marc Durdin
d63bd4edde chore(web): rebuild obolo_chwerty keyboard 2022-03-17 20:47:00 +11:00
Marc Durdin
c80140d618 chore(common): update obolo_chwerty_6347 for new store names 2022-03-17 05:32:50 +11:00
Marc Durdin
7a5d1b964f chore(web): Merge branch 'beta' into feat/web/6364-new-layer-old-layer-replaces-layerchanged 2022-03-17 04:55:25 +11:00
Marc Durdin
c74c8db6fe fix(common): obolo_chwerty package had broken link 2022-03-17 04:55:05 +11:00
Marc Durdin
1038379c41
Merge pull request #6351 from keymanapp/fix/web/caps-state-tracking-for-touch
fix(web): caps state tracking for touch
2022-03-15 10:04:45 +11:00
Marc Durdin
81ec8b86e2
Merge pull request #6347 from keymanapp/fix/developer/warn-on-ncaps-consistency
fix(developer): warn on ncaps usage inconsistency
2022-03-15 10:02:35 +11:00