Imported Upstream version 8.2.2
[platform/upstream/harfbuzz.git] / test / api / meson.build
1 if conf.get('HAVE_GLIB', 0) == 0
2   message('You need to have glib support enabled to run test/api tests')
3   subdir_done()
4 endif
5
6 tests = [
7   'test-aat-layout.c',
8   'test-baseline.c',
9   'test-base-minmax.c',
10   'test-be-glyph-advance.c',
11   'test-be-num-glyphs.c',
12   'test-blob.c',
13   'test-buffer.c',
14   'test-c.c',
15   'test-collect-unicodes.c',
16   'test-cplusplus.cc',
17   'test-common.c',
18   'test-draw.c',
19   'test-extents.c',
20   'test-font.c',
21   'test-font-scale.c',
22   'test-glyph-names.c',
23   'test-instance-cff2.c',
24   'test-map.c',
25   'test-object.c',
26   'test-ot-alternates.c',
27   'test-ot-collect-glyphs.c',
28   'test-ot-color.c',
29   'test-ot-face.c',
30   'test-ot-glyphname.c',
31   'test-ot-layout.c',
32   'test-ot-ligature-carets.c',
33   'test-ot-name.c',
34   'test-ot-meta.c',
35   'test-ot-metrics.c',
36   'test-ot-tag.c',
37   'test-ot-extents-cff.c',
38   'test-ot-metrics-tt-var.c',
39   'test-paint.c',
40   'test-subset-repacker.c',
41   'test-set.c',
42   'test-shape.c',
43   'test-style.c',
44   'test-subset.c',
45   'test-subset-cmap.c',
46   'test-subset-drop-tables.c',
47   'test-subset-glyf.c',
48   'test-subset-hdmx.c',
49   'test-subset-hmtx.c',
50   'test-subset-nameids.c',
51   'test-subset-os2.c',
52   'test-subset-post.c',
53   'test-subset-vmtx.c',
54   'test-subset-cff1.c',
55   'test-subset-cff2.c',
56   'test-subset-gvar.c',
57   'test-subset-hvar.c',
58   'test-subset-vvar.c',
59   'test-subset-sbix.c',
60   'test-subset-gpos.c',
61   'test-subset-colr.c',
62   'test-subset-cbdt.c',
63   'test-unicode.c',
64   'test-var-coords.c',
65   'test-version.c',
66 ]
67
68 if conf.get('HAVE_FREETYPE', 0) == 1
69   tests += [
70     'test-ot-math.c',
71     'test-ft.c',
72   ]
73 endif
74
75 if conf.get('HAVE_CORETEXT', 0) == 1
76   tests += [
77     'test-coretext.c',
78   ]
79 endif
80
81 if conf.get('HAVE_FREETYPE', 0) == 1 and conf.get('HAVE_PTHREAD', 0) == 1
82   tests += 'test-multithread.c'
83 endif
84
85 # Default test running environment
86 env = environment()
87 env.set('MALLOC_CHECK_', '2')
88 env.set('G_DEBUG', 'gc-friendly')
89 env.set('G_SLICE', 'always-malloc')
90 env.set('G_TEST_SRCDIR', meson.current_source_dir())
91 env.set('G_TEST_BUILDDIR', meson.current_build_dir())
92
93 foreach source : tests
94   cpp_args = []
95   test_name = source.split('.')[0]
96
97   deps = [glib_dep, freetype_dep, thread_dep, libharfbuzz_dep, libharfbuzz_icu_dep]
98   suite = ['api']
99   if test_name.contains('-subset') or test_name.contains('-instance')
100     deps += libharfbuzz_subset_dep
101     suite += 'subset'
102   endif
103
104   if test_name.contains('-instance')
105     cpp_args += '-DHB_EXPERIMENTAL_API'
106   endif
107
108   test(test_name, executable(test_name, source,
109     cpp_args:  cpp_args,
110     include_directories: [incconfig],
111     dependencies: deps,
112     install: false,
113   ), env: env, suite: suite)
114 endforeach