spiegel-keyman/core/tests/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

34 lines
1.4 KiB
Meson

# Copyright: © 2018 SIL International.
# Description: Cross platform build script to compile unit tests.
# Create Date: 2 Oct 2018
# Authors: Tim Eves (TSE)
# History: 2 Oct 2018 - TSE - Added tests for utfcodec & json.
# 19 Oct 2018 - TSE - Added kmnkbd directory for API unit tests.
#
# Note: this version of cmpfiles ignores line endings, which is better for platform independence
cmpfiles = ['-c', 'import sys; a = open(sys.argv[1], \'r\').read(); b = open(sys.argv[2], \'r\').read(); exit(not (a==b))']
stnds = join_paths(meson.current_source_dir(), 'standards')
libsrc = include_directories(join_paths('../', 'src'))
# kmx_test_source is required for linux builds, so always enable it even when we
# disable all other tests
subdir('kmx_test_source')
if get_option('keyman_core_tests')
message('option "keyman_core_tests" is true, enabling tests')
if get_option('default_library') != 'static'
ctypes_void_p_size = ['-c', 'import ctypes; print(ctypes.sizeof(ctypes.c_void_p))']
r = run_command(python, ctypes_void_p_size, check: true)
python_ctypes_compatible = r.stdout().to_int() == cpp_compiler.sizeof('void *')
if not python_ctypes_compatible
message('Python ctypes is incompatible with built shared object. Disabling some tests.')
endif
endif
subdir('unit')
else
message('option "keyman_core_tests" is false, disabling tests')
endif