spiegel-keyman/core/tests/unit/ldml/keyboards/meson.build
Marc Durdin 900f248558 chore(common): cleanup meson deprecations and warnings
Most warnings have been cleaned up:

* min meson version is now 1.0
* additional parameters such as check, recursive added
* uses now global_source_root() instead of source_root()
* catting files on Windows wasn't actually working -- used in unit
  tests. This is because meson passes paths with forward slashes to
  cmd.exe `type` command, which doesn't understand them. This is bad,
  because we were running effectively null tests for the affected tests.
  Fortunately, the same tests were configured correctly on macOS and
  Linux, and were all passing, so no serious damage.

There is one significant warning left:

`WARNING: Project targets '>=1.0' but uses feature deprecated since
'0.64.0': copy arg in configure_file. Use fs.copyfile instead`

Refer to mesonbuild/meson#12792. I have opened a PR against that to
undeprecate `copy` kwarg in a future version of meson.

Fixes: #8399
2024-05-24 08:46:52 +07:00

106 lines
2.6 KiB
Meson

# Copyright: © SIL International.
# Description: Cross platform build script to compile kmcoreldml API unit tests.
# Create Date: 5 Aug 2022
# Authors: Marc Durdin
#
# keyboards in resources/standards-data/ldml-keyboards/45/3.0/
# tests in resources/standards-data/ldml-keyboards/45/test/
tests_from_cldr = [
'ja-Latn',
'pt-t-k0-abnt2',
'fr-t-k0-test',
'pcm',
'bn',
]
# these have 'embedded' (@@) testdata instead of a separate file
tests_without_testdata = [
# disabling 000 until we have updates to core or to the keyboard so that it passes
# 'k_000_null_keyboard',
'k_002_tinyu32',
'k_003_transform',
'k_004_tinyshift',
'k_005_modbittest',
'k_010_mt',
'k_011_mt_iso',
'k_012_other',
'k_030_transform_plus',
'k_100_keytest',
'k_101_keytest',
'k_102_keytest',
]
# These tests have a *-test.xml file as well.
tests_with_testdata = [
'ldml_test',
'k_001_tiny',
'k_006_backspace',
'k_007_transform_rgx',
'k_008_transform_norm',
'k_009_transform_nfc',
'k_020_fr', # TODO-LDML: move to cldr above (fix vkey)
'k_200_reorder_nod_Lana',
'k_201_reorder_esk',
'k_210_marker',
'k_211_marker_escape',
'k_212_marker_11057',
]
tests = tests_without_testdata
tests += tests_with_testdata
tests_needing_copy = tests # not including cldr
tests += tests_from_cldr
# 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')
kmc_cmd = [node, '--enable-source-maps', kmc_root]
# Build all keyboards in output folder
foreach kbd : tests_needing_copy
configure_file(
copy: true,
input: kbd + '.xml',
output: kbd + '.xml'
)
configure_file(
command: kmc_cmd + ['build', '@INPUT@', '--out-file', '@OUTPUT@'],
input: kbd + '.xml',
output: kbd + '.kmx',
)
endforeach
foreach kbd : tests_with_testdata
configure_file(
command: kmc_cmd + ['build', 'ldml-test-data', '@INPUT@', '--out-file', '@OUTPUT@'],
input: kbd + '-test.xml',
output: kbd + '-test.json',
)
endforeach
foreach kbd : tests_from_cldr
configure_file(
copy: true,
input: ldml_data / kbd + '.xml',
output: kbd + '.xml'
)
configure_file(
command: kmc_cmd + ['build', '@INPUT@', '--out-file', '@OUTPUT@'],
input: join_paths(ldml_data, 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'),
output: kbd + '-test.json',
)
endforeach