File: meson.build

package info (click to toggle)
keyman 18.0.246-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,316 kB
  • sloc: python: 52,784; cpp: 21,289; sh: 7,633; ansic: 4,823; xml: 3,617; perl: 959; makefile: 139; javascript: 138
file content (37 lines) | stat: -rw-r--r-- 1,433 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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(); sys.exit(not (a==b))']
stnds = join_paths(meson.current_source_dir(), 'standards')

libsrc = include_directories(
  '../src',
  '../../common/include'
)

# 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