Imported Upstream version 2.6.7
[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-blob.c',
10   'test-buffer.c',
11   'test-c.c',
12   'test-collect-unicodes.c',
13   'test-cplusplus.cc',
14   'test-common.c',
15   'test-draw.c',
16   'test-font.c',
17   'test-map.c',
18   'test-object.c',
19   'test-ot-color.c',
20   'test-ot-face.c',
21   'test-ot-glyphname.c',
22   'test-ot-ligature-carets.c',
23   'test-ot-name.c',
24   'test-ot-meta.c',
25   'test-ot-metrics.c',
26   'test-ot-tag.c',
27   'test-ot-extents-cff.c',
28   'test-ot-metrics-tt-var.c',
29   'test-set.c',
30   'test-shape.c',
31   'test-subset.c',
32   'test-subset-cmap.c',
33   'test-subset-drop-tables.c',
34   'test-subset-glyf.c',
35   'test-subset-hdmx.c',
36   'test-subset-hmtx.c',
37   'test-subset-nameids.c',
38   'test-subset-os2.c',
39   'test-subset-post.c',
40   'test-subset-vmtx.c',
41   'test-subset-cff1.c',
42   'test-subset-cff2.c',
43   'test-subset-gvar.c',
44   'test-subset-hvar.c',
45   'test-subset-vvar.c',
46   'test-subset-sbix.c',
47   'test-subset-gpos.c',
48   'test-subset-colr.c',
49   'test-subset-cbdt.c',
50   'test-unicode.c',
51   'test-var-coords.c',
52   'test-version.c',
53 ]
54
55 if conf.get('HAVE_FREETYPE', 0) == 1
56   tests += 'test-ot-math.c'
57 endif
58
59 if conf.get('HAVE_FREETYPE', 0) == 1 and conf.get('HAVE_PTHREAD', 0) == 1
60   tests += 'test-multithread.c'
61 endif
62
63 # Default test running environment
64 env = environment()
65 env.set('MALLOC_CHECK_', '2')
66 env.set('G_DEBUG', 'gc-friendly')
67 env.set('G_SLICE', 'always-malloc')
68 env.set('G_TEST_SRCDIR', meson.current_source_dir())
69 env.set('G_TEST_BUILDDIR', meson.current_build_dir())
70
71 foreach source : tests
72   test_name = source.split('.')[0]
73
74   link_withs = libharfbuzz
75   if test_name.contains('-subset')
76     link_withs = [libharfbuzz, libharfbuzz_subset]
77   elif test_name == 'test-unicode' and have_icu and not have_icu_builtin
78     link_withs = [libharfbuzz, libharfbuzz_icu]
79   endif
80
81   test(test_name, executable(test_name, source,
82     include_directories: [incconfig, incsrc],
83     dependencies: deps,
84     link_with: link_withs,
85     install: false,
86   ), env: env, suite: ['api'] + (test_name.contains('-subset') ? ['subset'] : []))
87 endforeach