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), 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