mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-13 20:01:35 +01:00
test: refactor build
Put the tests definition inside a big dictionary (with the executable test name and the subtests). This allows to easily add more executables.
This commit is contained in:
parent
14d64ebe39
commit
6849a6af1f
1 changed files with 33 additions and 30 deletions
|
@ -15,36 +15,39 @@ mock_liftoff = declare_dependency(
|
||||||
dependencies: drm.partial_dependency(compile_args: true),
|
dependencies: drm.partial_dependency(compile_args: true),
|
||||||
)
|
)
|
||||||
|
|
||||||
test_alloc_exe = executable(
|
tests = {
|
||||||
'test-alloc',
|
'alloc': [
|
||||||
files('test_alloc.c'),
|
'basic',
|
||||||
dependencies: mock_liftoff,
|
'simple-1x',
|
||||||
)
|
'simple-1x-fail',
|
||||||
|
'simple-3x',
|
||||||
|
'zpos-3x',
|
||||||
|
'zpos-3x-intersect-fail',
|
||||||
|
'zpos-3x-intersect-partial',
|
||||||
|
'zpos-3x-disjoint-partial',
|
||||||
|
'zpos-3x-disjoint',
|
||||||
|
'zpos-4x-intersect-partial',
|
||||||
|
'zpos-4x-disjoint',
|
||||||
|
'zpos-4x-disjoint-alt',
|
||||||
|
'zpos-4x-domino-fail',
|
||||||
|
'zpos-4x-domino-partial',
|
||||||
|
'composition-3x',
|
||||||
|
'composition-3x-fail',
|
||||||
|
'composition-3x-partial',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
alloc_tests = [
|
foreach test_name, subtests : tests
|
||||||
'basic',
|
test_exe = executable(
|
||||||
'simple-1x',
|
'test-' + test_name,
|
||||||
'simple-1x-fail',
|
files('test_' + test_name + '.c'),
|
||||||
'simple-3x',
|
dependencies: mock_liftoff,
|
||||||
'zpos-3x',
|
|
||||||
'zpos-3x-intersect-fail',
|
|
||||||
'zpos-3x-intersect-partial',
|
|
||||||
'zpos-3x-disjoint-partial',
|
|
||||||
'zpos-3x-disjoint',
|
|
||||||
'zpos-4x-intersect-partial',
|
|
||||||
'zpos-4x-disjoint',
|
|
||||||
'zpos-4x-disjoint-alt',
|
|
||||||
'zpos-4x-domino-fail',
|
|
||||||
'zpos-4x-domino-partial',
|
|
||||||
'composition-3x',
|
|
||||||
'composition-3x-fail',
|
|
||||||
'composition-3x-partial',
|
|
||||||
]
|
|
||||||
|
|
||||||
foreach name : alloc_tests
|
|
||||||
test(
|
|
||||||
'alloc@' + name,
|
|
||||||
test_alloc_exe,
|
|
||||||
args: [name],
|
|
||||||
)
|
)
|
||||||
|
foreach subtest_name : subtests
|
||||||
|
test(
|
||||||
|
test_name + '@' + subtest_name,
|
||||||
|
test_exe,
|
||||||
|
args: [subtest_name],
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
endforeach
|
endforeach
|
||||||
|
|
Loading…
Reference in a new issue