Hash :
8687f5c3
Author :
Date :
2025-03-10T23:11:27
[face] Add tests for new constructors
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
if conf.get('HAVE_GLIB', 0) == 0
message('You need to have glib support enabled to run test/api tests')
subdir_done()
endif
tests = [
'test-aat-layout.c',
'test-baseline.c',
'test-base-minmax.c',
'test-be-glyph-advance.c',
'test-be-num-glyphs.c',
'test-blob.c',
'test-buffer.c',
'test-c.c',
'test-collect-unicodes.c',
'test-cplusplus.cc',
'test-common.c',
'test-draw.c',
'test-draw-varc.c',
'test-extents.c',
'test-face.c',
'test-font.c',
'test-font-scale.c',
'test-get-table-tags.c',
'test-glyph-names.c',
'test-instance-cff2.c',
'test-map.c',
'test-object.c',
'test-ot-alternates.c',
'test-ot-collect-glyphs.c',
'test-ot-color.c',
'test-ot-face.c',
'test-ot-glyphname.c',
'test-ot-layout.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-paint.c',
'test-subset-repacker.c',
'test-set.c',
'test-shape.c',
'test-shape-plan.c',
'test-style.c',
'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',
'test-unicode.c',
'test-var-coords.c',
'test-version.c',
]
if conf.get('HAVE_FREETYPE', 0) == 1
tests += [
'test-ot-math.c',
'test-ft.c',
]
endif
if conf.get('HAVE_CORETEXT', 0) == 1
tests += [
'test-coretext.c',
]
endif
if conf.get('HAVE_DIRECTWRITE', 0) == 1
tests += [
'test-directwrite.cc',
]
endif
if conf.get('HAVE_PTHREAD', 0) == 1
tests += 'test-multithread.c'
endif
# Default test running environment
env = environment()
env.set('MALLOC_CHECK_', '1')
env.set('G_DEBUG', 'gc-friendly')
env.set('G_TEST_SRCDIR', meson.current_source_dir())
env.set('G_TEST_BUILDDIR', meson.current_build_dir())
foreach source : tests
cpp_args = []
test_name = source.split('.')[0]
deps = [coretext_deps,
freetype_dep,
gdi_uniscribe_deps,
glib_dep,
graphite2_dep,
thread_dep,
libharfbuzz_dep,
libharfbuzz_icu_dep,
libharfbuzz_cairo_dep,
#libharfbuzz_gobject_dep
]
suite = ['api']
if test_name.contains('-subset') or test_name.contains('-instance')
deps += libharfbuzz_subset_dep
suite += 'subset'
endif
if test_name.contains('-instance')
cpp_args += '-DHB_EXPERIMENTAL_API'
endif
test(test_name, executable(test_name, source,
cpp_args: cpp_args,
include_directories: [incconfig],
dependencies: deps,
install: false,
), env: env, suite: suite)
endforeach