1test_inc = include_directories('include')
2
3# This mock library will replace libdrm
4mock_drm_lib = shared_library(
5	'drm',
6	files('libdrm_mock.c'),
7	include_directories: [test_inc],
8	dependencies: drm.partial_dependency(compile_args: true),
9	soversion: drm.version().split('.')[0], # TODO: get it from the real dep
10)
11
12mock_liftoff = declare_dependency(
13	link_with: [mock_drm_lib, liftoff_lib],
14	include_directories: [liftoff_inc, test_inc],
15	dependencies: drm.partial_dependency(compile_args: true),
16)
17
18bench_exe = executable(
19	'bench',
20	files('bench.c'),
21	dependencies: mock_liftoff,
22)
23
24tests = {
25	'alloc': [
26		'basic',
27		'no-props-fail',
28		'zero-fb-id-fail',
29		'composition-zero-fb-id',
30		'empty',
31		'simple-1x',
32		'simple-1x-fail',
33		'simple-3x',
34		'zpos-3x',
35		'zpos-3x-intersect-fail',
36		'zpos-3x-intersect-partial',
37		'zpos-3x-disjoint-partial',
38		'zpos-3x-disjoint',
39		'zpos-4x-intersect-partial',
40		'zpos-4x-disjoint',
41		'zpos-4x-disjoint-alt',
42		'zpos-4x-domino-fail',
43		'zpos-4x-domino-partial',
44		'composition-3x',
45		'composition-3x-fail',
46		'composition-3x-partial',
47		'composition-3x-force',
48	],
49	'dynamic': [
50		'same',
51		'fb',
52		'add-layer',
53		'remove-layer',
54		'change-composition-layer',
55	],
56	'priority': [
57		#'basic',
58	],
59	'prop': [
60		'default-alpha',
61		'default-rotation',
62		'ignore-alpha',
63	],
64}
65
66foreach test_name, subtests : tests
67	test_exe = executable(
68		'test-' + test_name,
69		files('test_' + test_name + '.c'),
70		dependencies: mock_liftoff,
71	)
72	foreach subtest_name : subtests
73		test(
74			test_name + '@' + subtest_name,
75			test_exe,
76			args: [subtest_name],
77		)
78	endforeach
79endforeach
80