mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-25 21:59:11 +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),
|
||||
)
|
||||
|
||||
test_alloc_exe = executable(
|
||||
'test-alloc',
|
||||
files('test_alloc.c'),
|
||||
dependencies: mock_liftoff,
|
||||
)
|
||||
tests = {
|
||||
'alloc': [
|
||||
'basic',
|
||||
'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 = [
|
||||
'basic',
|
||||
'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',
|
||||
]
|
||||
|
||||
foreach name : alloc_tests
|
||||
test(
|
||||
'alloc@' + name,
|
||||
test_alloc_exe,
|
||||
args: [name],
|
||||
foreach test_name, subtests : tests
|
||||
test_exe = executable(
|
||||
'test-' + test_name,
|
||||
files('test_' + test_name + '.c'),
|
||||
dependencies: mock_liftoff,
|
||||
)
|
||||
foreach subtest_name : subtests
|
||||
test(
|
||||
test_name + '@' + subtest_name,
|
||||
test_exe,
|
||||
args: [subtest_name],
|
||||
)
|
||||
endforeach
|
||||
endforeach
|
||||
|
|
Loading…
Reference in a new issue