summaryrefslogtreecommitdiff
path: root/tests/conform/meson.build
blob: 25c03c79438831449943591f76db55ea7d59611a (plain)
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
test_cflags = [
  '-DG_LOG_DOMAIN="Clutter-Conform"',
  '-DCOGL_DISABLE_DEPRECATION_WARNINGS',
]

test_env = [
  'G_ENABLE_DIAGNOSTIC=0',
  'CLUTTER_ENABLE_DIAGNOSTIC=0',
  'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
  'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
]

if enabled_backends.contains('x11')
  test_env += 'CLUTTER_BACKEND=x11'
endif

actor_tests = [
  'actor-anchors',
  'actor-destroy',
  'actor-graph',
  'actor-invariants',
  'actor-iter',
  'actor-layout',
  'actor-meta',
  'actor-offscreen-limit-max-size',
  'actor-offscreen-redirect',
  'actor-paint-opacity',
  'actor-pick',
#  'actor-shader-effect', # XXX - Fails on CI
  'actor-size',
]

classes_tests = [
  'text',
]

general_tests = [
  'binding-pool',
  'color',
  'events-touch',
  'interval',
  'model',
  'script-parser',
  'units',
]

deprecated_tests = [
  'animator',
  'behaviours',
  'group',
  'rectangle',
  'texture',
]

conformance_suites = [
  [ 'actor', actor_tests ],
  [ 'classes', classes_tests ],
  [ 'general', general_tests ],
  [ 'deprecated', deprecated_tests ],
]

installed_test_bindir = join_paths(clutter_libexecdir, 'installed-tests', meson.project_name())
installed_test_datadir = join_paths(clutter_datadir, 'installed-tests', meson.project_name())

foreach suite: conformance_suites
  suite_name = suite[0]
  suite_tests = suite[1]

  foreach t: suite_tests
    test_name = t
    test_source = t + '.c'

    test_data_conf = configuration_data()
    test_data_conf.set('test_bin', join_paths(installed_test_bindir, test_name))

    test_data = configure_file(
      input: 'test.data.in',
      output: t + '.test',
      configuration: test_data_conf,
      install_dir: installed_test_datadir,
    )

    test_bin = executable(test_name,
      test_source,
      c_args: test_cflags,
      dependencies: [ libclutter_dep, mathlib_dep ],
      install: true,
      install_dir: installed_test_bindir,
    )

    test(t, test_bin,
      suite: suite_name,
      env: test_env,
    )
  endforeach
endforeach