Newer
Older
subdir('fixtures')
liburcu_memb = option_urcu ? cc.find_library('urcu-memb') : disabler()
liburcu_cds = option_urcu ? cc.find_library('urcu-cds') : disabler()
# TODO: Parallel tests should be run without io_uring compiled
# into emper, to avoid running into `ulimit -l`.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
tests = [
{
'source': files('SimpleFibTest.cpp'),
'name': 'SimpleFibTest',
'description': 'Simple test',
},
{
'source': files('SimplestFibTest.cpp'),
'name': 'SimplestFibTest',
'description': 'Simplest fib test',
'test_suite': 'smoke',
'is_parallel': true,
},
{
'source': files('RuntimeDestroyTest.cpp'),
'name': 'RuntimeDestroyTest',
'description': 'Test runtime destruction',
'test_suite': 'smoke',
'is_parallel': true,
},
{
'source': files('c_api_test.c'),
'name': 'c_api_test',
'description': 'Test EMPER\'s C API',
},
{
'source': files('CppApiTest.cpp'),
'name': 'CppApiTest',
'description': 'Test EMPER\'s C++ API',
},
{
'source': files('YieldToAnywhereTest.cpp'),
'name': 'YieldToAnywhereTest',
'description': 'Test emper::yieldToAnywhere',
'test_runner': 'emper',
},
{
'source': files('ReuseBpsTest.cpp'),
'name': 'ReuseBpsTest',
'description': 'Test resetting of BPSs',
'test_runner': 'emper',
},
{
'source': files('SimpleActorTest.cpp'),
'name': 'SimpleActorTest',
'description': 'Simple Actor Test',
},
{
'source': files('AlarmActorTest.cpp'),
'name': 'AlarmActorTest',
'description': 'Use an Actor to unblock fibers using BPS',
},
{
'source': files('UnblockOnMainActorTest.cpp'),
'name': 'UnblockOnMainActorTest',
'description': 'Slight modification of AlarmActorTest using the main thread to signal BPS',
},
{
'source': files('SimpleLawsTest.cpp'),
'name': 'SimpleLawsTest',
'description': 'Simple LAWS scheduling strategy test',
},
{
'source': files('SimpleUrcuTest.cpp'),
'name': 'SimpleUrcuTest',
'description': 'Simple userspace-rcu hash table test',
'dependencies': [liburcu_memb, liburcu_cds]
},
{
'source': files('SignalPrivateSemaphoreFromAnywhereTest.cpp'),
'name': 'SignalPrivateSemaphoreFromAnywhereTest',
'description': 'Simple test for PrivateSemaphore:signalFromAnywhere()',
'test_suite': 'smoke',
'is_parallel': true,
'test_runner': 'emper',
},
{
'source': files('TellActorFromAnywhereTest.cpp'),
'name': 'TellActorFromAnywhereTest',
'description': 'Simple test for Actor:tellFromAnywhere()',
'test_suite': 'smoke',
'is_parallel': true,
'test_runner': 'emper',
},
]
subdir('io')
subdir('lib')
undef_ndebug = '-UNDEBUG'
test_env = environment(
{
# Set glibc's MALLOC_PERTURB to 1. This means that newly allocated
# memory will be initialized with 0x01, and that free'ed memory
# will be set to 0xFE (I think).
'MALLOC_PERTURB_': '1',
}
)
io_uring_enabled = get_option('io')
parallel_ok = (not io_uring_enabled)
# Meson integration for GTest and GMock
# See https://mesonbuild.com/Dependencies.html#gtest-and-gmock
gtest_dep = dependency('gtest', main: true, required: false)
# If gtest is not available on the system use the meson wrap provided
# by WrapDB and build it ourself
if not gtest_dep.found()
gtest_sp = subproject('gtest')
gtest_dep = gtest_sp.get_variable('gtest_main_dep')
endif
fs = import('fs')
foreach test_dict : tests
# The test_name is the name of the source file without the file suffix'.
source = test_dict['source'][0]
# Currently fs does not support files() objects
# https://github.com/mesonbuild/meson/issues/8608
# TODO: Use meson fs (filesystem) module once this is solved an in buster-backports
test_name = test_dict['name']
test_deps = [thread_dep, test_fixtures]
if test_dict.get('gtest', false)
test_deps += gtest_dep
endif
test_deps += test_dict['dependencies']
if test_dict.has_key('test_runner')
test_deps += test_runners[test_dict['test_runner']]
test_exe = executable(test_name,
source,
include_directories: emper_all_include,
c_args: undef_ndebug,
cpp_args: undef_ndebug,
dependencies: [emper_full_dep] + test_deps,
test_is_parallel = test_dict.get('is_parallel', false)
test(test_name,
is_parallel: test_is_parallel and parallel_ok,
suite: test_dict.get('test_suite', 'all'),
timeout: test_dict.get('timeout', 180),
args: test_dict.get('args', []),
should_fail: test_dict.get('should_fail', false),