Commit graph

5430 commits

Author SHA1 Message Date
Dr Mark C. Sinclair
920b702eef chore(common/web): add five test cases for replaceExtension(), two commented out as failing 2024-11-28 05:56:22 +00:00
Dr Mark C. Sinclair
589698b799 chore(common/web): add three test cases for filenameIs() 2024-11-28 05:16:48 +00:00
Dr Mark C. Sinclair
5a56d0f159 chore(common/web): add four test cases for binaryTypeFromFilename() 2024-11-28 03:21:16 +00:00
Dr Mark C. Sinclair
d08b6933f4 chore(common/web): add four test cases for sourceTypeFromFilename() 2024-11-28 03:16:17 +00:00
Dr Mark C. Sinclair
1782f8db09 chore(common/web): add four test cases for sourceOrBinaryTypeFromFilename() 2024-11-28 03:03:48 +00:00
Marc Durdin
e640caaa9c chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-11-28 09:53:45 +07:00
Marc Durdin
d71cb56ca7 fix(core): rename assert() to test_assert() in unit tests
Had a real yak shave this morning with disabling assertions in release
builds in our C/C++ code. It turns out that our unit tests use
`assert()` which we intended to use from `test_assert.h`, but in some
cases `cassert` or `assert.h` had been #included after `test_assert.h`,
overriding our special `assert()` macro. The chain of includes is
somewhat hard to puzzle out -- it's often buried several levels deep.
This meant that a release build would drop all test assertions, meaning
most tests passed, unsurprisingly, as there were no assertions left to
fail ... but some tests failed with crashes because we optimized out
important lines such as `assert(some_important_function())`.

I was quite unhappy with this fragility, so I have opted to rename
`assert()` to `test_assert()` in all of our home-grown C/C++ unit tests,
which further highlighted unit tests which were only using the C/C++
`assert()` and not ours, so then had to figure out which unit test
executables needed to have `test_assert` added, and then ... then ...
discovered a bug in `test_color.h`, where we were #including
`io.h`/`unistd.h` inside a `namespace console_color {}` block, which
just happened to be the first ref to those beautiful headers, and thus
(because `#pragma once`) meant that useful little functions like
`access()` were no longer accessible to us in the global namespace.

I have also audited Every Single Call to `assert()` to verify that we do
not do Important Work inside the parentheses, and, apart from those
offending unit tests, now resolved with `test_assert()`, it looks like
all is good.

I would like to present one very well-shaved yak in this commit.

Fixes: #12619
2024-11-28 09:46:01 +07:00
Dr Mark C. Sinclair
324c57f793 chore(common/web): test Source file extension removal 2024-11-28 02:19:19 +00:00
Dr Mark C. Sinclair
3682766ff7 chore(common/web): add copyright banner 2024-11-28 02:15:46 +00:00
Dr Mark C. Sinclair
ba44fe6fcb chore(common/web): Merge branch 'test/common/web/types/9052-unit-tests-unicodeset-parser-api' into test/common/web/types/9052-unit-tests-file-types 2024-11-28 02:11:40 +00:00
Dr Mark C. Sinclair
66d0587370 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-file-types 2024-11-28 02:10:56 +00:00
Dr Mark C. Sinclair
a2cb00aa81 chore(common/web): add copyright banner 2024-11-28 02:01:45 +00:00
Dr Mark C. Sinclair
6bc46b030f chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-unicodeset-parser-api 2024-11-28 01:54:50 +00:00
Dr Mark C. Sinclair
1837529765 chore(common/web): add braces to for loop in initListItem() 2024-11-28 01:48:16 +00:00
Dr Mark C. Sinclair
4dbb33eac4 chore(common/web): add copyright banner 2024-11-28 01:43:37 +00:00
Eberhard Beilharz
d151d0999f
refactor(common): output number of tests when running on TC
This change adds the mocha-teamcity-reporter which outputs the running
tests in a special format that TeamCity can interpret. This allows TC
to show which tests run as well as the number of tests run.
2024-11-27 11:15:43 +01:00
Marc Durdin
18d00c7701 fix(core): use NDEBUG flag to disable assertions in release build for VC++
This disables assertions in release builds in Windows only. Other
platforms may have different outcomes.

Fixes: #12619
2024-11-27 15:34:34 +07:00
Dr Mark C. Sinclair
bf7f4c2bc2 chore(common/web): add initial removeExtension test cases 2024-11-27 08:34:06 +00:00
Dr Mark C. Sinclair
acf156b965 chore(common/web): add test-unicodeset-parser.ts to test UnicodeSet 2024-11-27 07:02:44 +00:00
Dr Mark C. Sinclair
60967375a3 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-string-list 2024-11-27 06:25:53 +00:00
Dr Mark C. Sinclair
402b4065e0 chore(common/web): refactor tests for readability 2024-11-27 06:10:45 +00:00
Dr Mark C. Sinclair
19da0c73ae chore(developer): add four additional test cases 2024-11-27 05:48:51 +00:00
Dr Mark C. Sinclair
b3398fb941 chore(developer): add test cases for ListItem.toString() and toStringArray() 2024-11-27 05:39:56 +00:00
Dr Mark C. Sinclair
04a8a0a5d5 chore(developer): add seven test cases for ListItem.compareTo 2024-11-27 05:33:07 +00:00
Dr Mark C. Sinclair
d77c5aeb6b chore(developer): add seven additional test cases for ListItem.isEqual 2024-11-27 05:16:24 +00:00
Dr Mark C. Sinclair
769259e6f6 chore(developer): add four test cases for ListItem.isEqual, plus refactor for length 2024-11-27 05:04:20 +00:00
Marc Durdin
b54b005830 refactor(common): move remaining LDML keyboard types into LdmlKeyboardTypes
Follows: #12712
2024-11-27 11:52:53 +07:00
Dr Mark C. Sinclair
88b0f712d0 chore(developer): add three ListItem.getItemOrder() test cases 2024-11-27 03:47:28 +00:00
Dr Mark C. Sinclair
15c71d7b95 chore(developer): add a further ListItem.fromStrings() test case 2024-11-27 03:38:24 +00:00
Dr Mark C. Sinclair
ef46a8eab1 chore(developer): add a ListItem.fromStrings() test case 2024-11-27 03:28:36 +00:00
Marc Durdin
e8bc0773df refactor(common): LexicalModelTypes tests
Fixes: #12516
2024-11-27 10:03:13 +07:00
Marc Durdin
b10634eb97 refactor(common): move all lexical model types into LexicalModelTypes container
Many of the types had very generic names (e.g. `Configuration`), and as
the types are now exported from `@keymanapp/common-types`, this was
unhelpful.

For units with many references, I used TypeScript's import-equals to
reduce the change impact. For units with only a few references, I added
the `LexicalModelTypes.` prefix to the references in source.

(Best reference I could find for import-equals: b722fa4e49)

Fixes: #12516
2024-11-27 09:46:09 +07:00
Dr Mark C. Sinclair
a5c80243e7 chore(developer): add six test cases for ListIndex 2024-11-27 02:24:11 +00:00
Dr Mark C. Sinclair
fa4f1e5d0f chore(developer): add one ListItem test case 2024-11-26 08:50:36 +00:00
Dr Mark C. Sinclair
2cb2e8c4fb chore(developer): initial commit of test-string-lists.ts 2024-11-26 08:08:15 +00:00
Marc Durdin
5a93bdf6c2 chore(developer): make package subfile description fully optional
The package subfile description field is never really used in the
end-user apps. As it is meaningless metadata, we'll make it fully
optional, and start to remove all references in the designers and
compilers.

TODO: For packages targeting Keyman 18.0+, we should consider removing
the description field altogether from the subfiles.
2024-11-13 10:03:26 +07:00
rc-swag
e58e690178
Merge pull request #12079 from keymanapp/feat/windows/add-apply-now-update
feat(windows): add state machine to control installation including apply now update  💽
2024-11-12 13:44:57 +10:00
Marc Durdin
4aa01a7ab6
Merge branch 'epic/linux-mcompile' into chore/merge-master-into-linux-mcompile 2024-11-08 05:27:33 +01:00
Marc Durdin
e7a80131c3
Merge branch 'epic/windows-updates' into chore/merge-master-into-windows-updates 2024-11-08 05:27:06 +01:00
Marc Durdin
eefbdc413d
Merge pull request #12555 from keymanapp/feat/developer/kmc-copy
feat(developer): kmc-copy
2024-11-08 05:14:02 +01:00
Marc Durdin
b80c124ec8
Merge pull request #11014 from keymanapp/feat/developer/kmc-generate
feat(developer): kmc generate
2024-11-08 05:13:51 +01:00
rc-swag
79a23a71fd chore(windows): Merge branch 'epic/windows-updates' into feat/windows/add-apply-now-update
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
#     Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
#     Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
2024-11-06 14:29:57 +10:00
Steven R. Loomis
3eac4f12c9 fix(common): check for invalid markers
- pattern parser update
- correct spelling of Error_InvalidVariableIdentifier
- track and report bad marker strings (look like markers but not)
- fix: may have missed markers mentioned in variables
- tests for above

Fixes: 12467
2024-11-04 10:15:56 -06:00
Steven R. Loomis
fb4f22da66 fix(common): check for invalid markers
- pattern parser update

Fixes: 12467
2024-11-01 16:50:25 -05:00
rc-swag
f2d0e268a7 feat(windows): remove TUpdateStateMachineParams
There was some dead code from before the RemoteUpdateCheck refactor
was created. This is removed in this commit
2024-10-30 16:59:32 +10:00
Marc Durdin
40db1c2051 feat(common): add isDirectory, helper functions for kmc-copy 2024-10-22 10:28:03 +07:00
rc-swag
c988271628
feat(windows): formatting review suggestions
Co-authored-by: Marc Durdin <marc@durdin.net>
2024-10-15 12:12:21 +10:00
Marc Durdin
496fe0df59
Merge branch 'epic/linux-mcompile' into feat/mac/mcompile_mac 2024-10-11 04:53:49 +02:00
Marc Durdin
0d9688451d
Merge branch 'master' into feat/developer/kmc-generate 2024-10-11 03:26:54 +02:00
Marc Durdin
cb0a60a1b4
Merge branch 'epic/windows-updates' into chore/merge-master-into-windows-updates 2024-10-11 01:20:41 +02:00