harfbuzz/test/api/meson.build
Christoph Reiter 8ae06c9489 meson: build a separate library for harfbuzz-icu
This adds a seperate library like with autotools.

This also fixes the ico feature option which was just set to required:false
when disabled instead of really disabling it.
Disabling is still broken with msvc because it then tries to find the library
another way, but that's broken for all other deps as well so I left it as is.

For tests only test-unicode.c is using icu specific functions so split it out
into its own category which depends on harfbuzz-icu.

Fixes #2338
2020-04-18 23:34:31 +04:30

106 lines
2.6 KiB
Meson

if conf.get('HAVE_GLIB', 0) == 1
tests = [
'test-aat-layout.c',
'test-baseline.c',
'test-blob.c',
'test-buffer.c',
'test-c.c',
'test-collect-unicodes.c',
'test-cplusplus.cc',
'test-common.c',
'test-draw.c',
'test-font.c',
'test-map.c',
'test-object.c',
'test-ot-color.c',
'test-ot-face.c',
'test-ot-glyphname.c',
'test-ot-ligature-carets.c',
'test-ot-name.c',
'test-ot-meta.c',
'test-ot-metrics.c',
'test-ot-tag.c',
'test-ot-extents-cff.c',
'test-ot-metrics-tt-var.c',
'test-set.c',
'test-shape.c',
'test-var-coords.c',
'test-version.c',
]
subset_tests = [
'test-subset.c',
'test-subset-cmap.c',
'test-subset-drop-tables.c',
'test-subset-glyf.c',
'test-subset-hdmx.c',
'test-subset-hmtx.c',
'test-subset-nameids.c',
'test-subset-os2.c',
'test-subset-post.c',
'test-subset-vmtx.c',
'test-subset-cff1.c',
'test-subset-cff2.c',
'test-subset-gvar.c',
'test-subset-hvar.c',
'test-subset-vvar.c',
'test-subset-sbix.c',
'test-subset-gpos.c',
'test-subset-colr.c',
'test-subset-cbdt.c',
]
icu_tests = []
if conf.get('HAVE_ICU', 0) == 1
icu_tests += 'test-unicode.c'
endif
if conf.get('HAVE_FREETYPE', 0) == 1
tests += 'test-ot-math.c'
endif
if conf.get('HAVE_FREETYPE', 0) == 1 and conf.get('HAVE_PTHREAD', 0) == 1
tests += 'test-multithread.c'
endif
# Default test running environment
env = environment()
env.set('MALLOC_CHECK_', '2')
env.set('G_DEBUG', 'gc-friendly')
env.set('G_SLICE', 'always-malloc')
env.set('G_TEST_SRCDIR', meson.current_source_dir())
env.set('G_TEST_BUILDDIR', meson.current_build_dir())
foreach source : tests
test_name = source.split('.')[0]
test(test_name, executable(test_name, source,
include_directories: [incconfig, incsrc],
dependencies: deps,
link_with: libharfbuzz,
install: false,
), env: env)
endforeach
foreach source : subset_tests
test_name = source.split('.')[0]
test(test_name, executable(test_name, source,
include_directories: [incconfig, incsrc],
dependencies: deps,
link_with: [libharfbuzz, libharfbuzz_subset],
install: false,
), env: env)
endforeach
foreach source : icu_tests
test_name = source.split('.')[0]
test(test_name, executable(test_name, source,
include_directories: [incconfig, incsrc],
dependencies: deps,
link_with: [libharfbuzz, libharfbuzz_icu],
install: false,
), env: env)
endforeach
else
message('You need to have glib support enabled to run test/api tests')
endif