diff --git a/common/web/types/build.sh b/common/web/types/build.sh index 7141bc10720..b97cb8f3d4a 100755 --- a/common/web/types/build.sh +++ b/common/web/types/build.sh @@ -30,8 +30,8 @@ builder_parse "$@" function compile_schemas() { # We need the schema files at runtime and bundled, so always copy it for all actions except `clean` local schemas=( - "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/45/ldml-keyboard3.schema.json" - "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/45/ldml-keyboardtest3.schema.json" + "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/46/ldml-keyboard3.schema.json" + "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/46/ldml-keyboardtest3.schema.json" "$KEYMAN_ROOT/common/schemas/kvks/kvks.schema.json" "$KEYMAN_ROOT/common/schemas/kpj/kpj.schema.json" "$KEYMAN_ROOT/common/schemas/kpj-9.0/kpj-9.0.schema.json" diff --git a/core/tests/unit/ldml/keyboards/meson.build b/core/tests/unit/ldml/keyboards/meson.build index 15f458c587f..0ba90fa8ff6 100644 --- a/core/tests/unit/ldml/keyboards/meson.build +++ b/core/tests/unit/ldml/keyboards/meson.build @@ -7,8 +7,16 @@ # keyboards in resources/standards-data/ldml-keyboards/45/3.0/ # tests in resources/standards-data/ldml-keyboards/45/test/ -tests_from_cldr = [ +tests_from_cldr_45 = [ 'ja-Latn', + # 'pt-t-k0-abnt2', + # 'fr-t-k0-test', + # 'pcm', + # 'bn', +] + +tests_from_cldr_46 = [ + # 'ja-Latn', 'pt-t-k0-abnt2', 'fr-t-k0-test', 'pcm', @@ -52,14 +60,18 @@ tests = tests_without_testdata tests += tests_with_testdata tests_needing_copy = tests # not including cldr -tests += tests_from_cldr +tests += tests_from_cldr_46 +tests += tests_from_cldr_45 # Setup kmc kmc_root = meson.global_source_root() / '../developer/src/kmc' -ldml_root = meson.global_source_root() / '../resources/standards-data/ldml-keyboards/45' -ldml_data = join_paths(ldml_root, '3.0') -ldml_testdata = join_paths(ldml_root, 'test') +ldml_root_45 = meson.global_source_root() / '../resources/standards-data/ldml-keyboards/45' +ldml_data_45 = join_paths(ldml_root_45, '3.0') +ldml_testdata_45 = join_paths(ldml_root_45, 'test') +ldml_root_46 = meson.global_source_root() / '../resources/standards-data/ldml-keyboards/46' +ldml_data_46 = join_paths(ldml_root_46, '3.0') +ldml_testdata_46 = join_paths(ldml_root_46, 'test') kmc_cmd = [node, '--enable-source-maps', kmc_root] # Build all keyboards in output folder @@ -87,20 +99,38 @@ foreach kbd : tests_with_testdata endforeach -foreach kbd : tests_from_cldr +foreach kbd : tests_from_cldr_45 + configure_file( + copy: true, + input: ldml_data_45 / kbd + '.xml', + output: kbd + '.xml' + ) + configure_file( + command: kmc_cmd + ['build', '@INPUT@', '--out-file', '@OUTPUT@'], + input: join_paths(ldml_data_45, kbd + '.xml'), + output: kbd + '.kmx', + ) + configure_file( + command: kmc_cmd + ['build', 'ldml-test-data', '@INPUT@', '--out-file', '@OUTPUT@'], + input: join_paths(ldml_testdata_45, kbd + '-test.xml'), + output: kbd + '-test.json', + ) +endforeach + +foreach kbd : tests_from_cldr_46 configure_file( copy: true, - input: ldml_data / kbd + '.xml', + input: ldml_data_46 / kbd + '.xml', output: kbd + '.xml' ) configure_file( command: kmc_cmd + ['build', '@INPUT@', '--out-file', '@OUTPUT@'], - input: join_paths(ldml_data, kbd + '.xml'), + input: join_paths(ldml_data_46, kbd + '.xml'), output: kbd + '.kmx', ) configure_file( command: kmc_cmd + ['build', 'ldml-test-data', '@INPUT@', '--out-file', '@OUTPUT@'], - input: join_paths(ldml_testdata, kbd + '-test.xml'), + input: join_paths(ldml_testdata_46, kbd + '-test.xml'), output: kbd + '-test.json', ) endforeach diff --git a/core/tests/unit/ldml/meson.build b/core/tests/unit/ldml/meson.build index 20ad621b506..a4be0486042 100644 --- a/core/tests/unit/ldml/meson.build +++ b/core/tests/unit/ldml/meson.build @@ -162,6 +162,19 @@ foreach kbd : tests test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-keyboards') endforeach +foreach kbd : tests_from_cldr_45 + kbd_src = test_path / kbd + '.xml' + kbd_obj = test_path / kbd + '.kmx' + test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-keyboards') +endforeach + +foreach kbd : tests_from_cldr_46 + kbd_src = test_path / kbd + '.xml' + kbd_obj = test_path / kbd + '.kmx' + test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-keyboards') +endforeach + + # Run tests on all invalid keyboards (`invalid_tests` defined in invalid-keyboards/meson.build) foreach kbd : invalid_tests diff --git a/developer/src/common/web/utils/test/kmx/test-ldml-keyboard-xml-reader.ts b/developer/src/common/web/utils/test/kmx/test-ldml-keyboard-xml-reader.ts index a79960c7ca2..ce175231efc 100644 --- a/developer/src/common/web/utils/test/kmx/test-ldml-keyboard-xml-reader.ts +++ b/developer/src/common/web/utils/test/kmx/test-ldml-keyboard-xml-reader.ts @@ -32,7 +32,7 @@ describe('ldml keyboard xml reader tests', function () { instancePath: '/keyboard3/conformsTo', keyword: 'enum', message: `must be equal to one of the allowed values`, - params: 'allowedValues="45"', + params: 'allowedValues="45,46"', })], }, {