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:
Simon Ser 2019-10-14 18:19:06 +03:00
parent 14d64ebe39
commit 6849a6af1f
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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