Skip to content
Snippets Groups Projects
Commit 9b833679 authored by Florian Fischer's avatar Florian Fischer
Browse files

[tests] restructure tests directory

Move io and lib related tests into io/ and lib/.

Our test dictionaries not must have a 'source' key with an array
created with files().
This ensures we use always correct paths regardless of the actual directory
we are currently in.

Until https://github.com/mesonbuild/meson/issues/8608 is not solved
we have to separately specify the tests name in a 'name' key.
parent 820575a0
No related branches found
No related tags found
1 merge request!152[tests] restructure tests directory
Showing with 216 additions and 176 deletions
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
tests += [
{
'source': files('IncrementalCompletionTest.cpp'),
'name': 'IncrementalCompletionTest',
'description': 'Test incremental completion for hugre reads/writes',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('ReuseFutureTest.cpp'),
'name': 'ReuseFutureTest',
'description': 'Test reusing Future objects',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('LinkFutureTest.cpp'),
'name': 'LinkFutureTest',
'description': 'Test linking Future objects',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('TooLongFutureChain.cpp'),
'name': 'TooLongFutureChain',
'description': 'Test linking Future objects',
'test_suite': 'io',
'should_fail': true,
'test_runner': 'io',
},
{
'source': files('AlarmFutureTest.cpp'),
'name': 'AlarmFutureTest',
'description': 'Test AlarmFuture object based timeouts',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('FutureCallbackTest.cpp'),
'name': 'FutureCallbackTest',
'description': 'Test Future callback',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('TimeoutWrapperTest.cpp'),
'name': 'TimeoutWrapperTest',
'description': 'Test TimeoutWrapper object based IO request timeouts',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('CancelFutureTest.cpp'),
'name': 'CancelFutureTest',
'description': 'Test Future cancellation',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('SimpleNetworkTest.cpp'),
'name': 'SimpleNetworkTest',
'description': 'Simple network test',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('SimpleDiskAndNetworkTest.cpp'),
'name': 'SimpleDiskAndNetworkTest',
'description': 'Simple network and disk IO test',
'test_suite': 'io',
'test_runner': 'io',
},
{
'source': files('ConcurrentNetworkEchoTest.cpp'),
'name': 'ConcurrentNetworkEchoTest',
'description': 'Concurrent network echo test with 10 clients',
'test_suite': 'io',
'args': ['10', '10000'],
},
]
File moved
File moved
tests += [
{
'source': files('TemplateUtilTest.cpp'),
'name': 'TemplateUtilTest',
'gtest': true,
'is_parallel': true,
},
{
'source': files('MathTest.cpp'),
'name': 'MathTest',
'description': 'Tests various functionality from emper::lib',
'gtest': true,
'is_parallel': true,
},
]
...@@ -6,176 +6,107 @@ liburcu_cds = option_urcu ? cc.find_library('urcu-cds') : disabler() ...@@ -6,176 +6,107 @@ liburcu_cds = option_urcu ? cc.find_library('urcu-cds') : disabler()
# TODO: Parallel tests should be run without io_uring compiled # TODO: Parallel tests should be run without io_uring compiled
# into emper, to avoid running into `ulimit -l`. # into emper, to avoid running into `ulimit -l`.
tests = { tests = [
'SimpleFibTest.cpp': {
{ 'source': files('SimpleFibTest.cpp'),
'description': 'Simple test', 'name': 'SimpleFibTest',
}, 'description': 'Simple test',
},
'SimplestFibTest.cpp':
{ {
'description': 'Simplest fib test', 'source': files('SimplestFibTest.cpp'),
'test_suite': 'smoke', 'name': 'SimplestFibTest',
'is_parallel': true, 'description': 'Simplest fib test',
}, 'test_suite': 'smoke',
'is_parallel': true,
'RuntimeDestroyTest.cpp': },
{
'description': 'Test runtime destruction', {
'test_suite': 'smoke', 'source': files('RuntimeDestroyTest.cpp'),
'is_parallel': true, 'name': 'RuntimeDestroyTest',
}, 'description': 'Test runtime destruction',
'test_suite': 'smoke',
'c_api_test.c': 'is_parallel': true,
{ },
'description': 'Test EMPER\'s C API',
}, {
'source': files('c_api_test.c'),
'CppApiTest.cpp': 'name': 'c_api_test',
{ 'description': 'Test EMPER\'s C API',
'description': 'Test EMPER\'s C++ API', },
},
{
'YieldToAnywhereTest.cpp': 'source': files('CppApiTest.cpp'),
{ 'name': 'CppApiTest',
'description': 'Test emper::yieldToAnywhere', 'description': 'Test EMPER\'s C++ API',
'test_runner': 'emper', },
},
{
'ReuseBpsTest.cpp': 'source': files('YieldToAnywhereTest.cpp'),
{ 'name': 'YieldToAnywhereTest',
'description': 'Test resetting of BPSs', 'description': 'Test emper::yieldToAnywhere',
'test_runner': 'emper', 'test_runner': 'emper',
}, },
'SimpleActorTest.cpp': {
{ 'source': files('ReuseBpsTest.cpp'),
'description': 'Simple Actor Test', 'name': 'ReuseBpsTest',
}, 'description': 'Test resetting of BPSs',
'test_runner': 'emper',
'AlarmActorTest.cpp': },
{
'description': 'Use an Actor to unblock fibers using BPS', {
}, 'source': files('SimpleActorTest.cpp'),
'name': 'SimpleActorTest',
'UnblockOnMainActorTest.cpp': 'description': 'Simple Actor Test',
{ },
'description': 'Slight modification of AlarmActorTest using the main thread to signal BPS',
}, {
'source': files('AlarmActorTest.cpp'),
'SimpleLawsTest.cpp': 'name': 'AlarmActorTest',
{ 'description': 'Use an Actor to unblock fibers using BPS',
'description': 'Simple LAWS scheduling strategy test', },
},
'SimpleUrcuTest.cpp': {
{ 'source': files('UnblockOnMainActorTest.cpp'),
'description': 'Simple userspace-rcu hash table test', 'name': 'UnblockOnMainActorTest',
'dependencies': [liburcu_memb, liburcu_cds] 'description': 'Slight modification of AlarmActorTest using the main thread to signal BPS',
}, },
'SignalPrivateSemaphoreFromAnywhereTest.cpp':
{ {
'description': 'Simple test for PrivateSemaphore:signalFromAnywhere()', 'source': files('SimpleLawsTest.cpp'),
'test_suite': 'smoke', 'name': 'SimpleLawsTest',
'is_parallel': true, 'description': 'Simple LAWS scheduling strategy test',
'test_runner': 'emper', },
},
'TellActorFromAnywhereTest.cpp': {
{ 'source': files('SimpleUrcuTest.cpp'),
'description': 'Simple test for Actor:tellFromAnywhere()', 'name': 'SimpleUrcuTest',
'test_suite': 'smoke', 'description': 'Simple userspace-rcu hash table test',
'is_parallel': true, 'dependencies': [liburcu_memb, liburcu_cds]
'test_runner': 'emper', },
},
{
'IncrementalCompletionTest.cpp': 'source': files('SignalPrivateSemaphoreFromAnywhereTest.cpp'),
{ 'name': 'SignalPrivateSemaphoreFromAnywhereTest',
'description': 'Test incremental completion for hugre reads/writes', 'description': 'Simple test for PrivateSemaphore:signalFromAnywhere()',
'test_suite': 'io', 'test_suite': 'smoke',
'test_runner': 'io', 'is_parallel': true,
}, 'test_runner': 'emper',
},
'ReuseFutureTest.cpp':
{ {
'description': 'Test reusing Future objects', 'source': files('TellActorFromAnywhereTest.cpp'),
'test_suite': 'io', 'name': 'TellActorFromAnywhereTest',
'test_runner': 'io', 'description': 'Simple test for Actor:tellFromAnywhere()',
}, 'test_suite': 'smoke',
'is_parallel': true,
'LinkFutureTest.cpp': 'test_runner': 'emper',
{ },
'description': 'Test linking Future objects', ]
'test_suite': 'io',
'test_runner': 'io', subdir('io')
}, subdir('lib')
'TooLongFutureChain.cpp':
{
'description': 'Test linking Future objects',
'test_suite': 'io',
'should_fail': true,
'test_runner': 'io',
},
'AlarmFutureTest.cpp':
{
'description': 'Test AlarmFuture object based timeouts',
'test_suite': 'io',
'test_runner': 'io',
},
'FutureCallbackTest.cpp':
{
'description': 'Test Future callback',
'test_suite': 'io',
'test_runner': 'io',
},
'TimeoutWrapperTest.cpp':
{
'description': 'Test TimeoutWrapper object based IO request timeouts',
'test_suite': 'io',
'test_runner': 'io',
},
'CancelFutureTest.cpp':
{
'description': 'Test Future cancellation',
'test_suite': 'io',
'test_runner': 'io',
},
'SimpleNetworkTest.cpp':
{
'description': 'Simple network test',
'test_suite': 'io',
'test_runner': 'io',
},
'SimpleDiskAndNetworkTest.cpp':
{
'description': 'Simple network and disk IO test',
'test_suite': 'io',
'test_runner': 'io',
},
'ConcurrentNetworkEchoTest.cpp':
{
'description': 'Concurrent network echo test with 10 clients',
'test_suite': 'io',
'args': ['10', '10000'],
},
'TemplateUtilTest.cpp':
{
'gtest': true,
'is_parallel': true,
},
'LibTest.cpp':
{
'description': 'Tests various functionality from emper::lib',
'gtest': true,
'is_parallel': true,
},
}
undef_ndebug = '-UNDEBUG' undef_ndebug = '-UNDEBUG'
test_env = environment( test_env = environment(
...@@ -203,12 +134,15 @@ if not gtest_dep.found() ...@@ -203,12 +134,15 @@ if not gtest_dep.found()
gtest_dep = gtest_sp.get_variable('gtest_main_dep') gtest_dep = gtest_sp.get_variable('gtest_main_dep')
endif endif
foreach source, test_dict : tests fs = import('fs')
# TODO: Use meson fs (filesystem) module once meson >= 0.53 is in
# buster-backports, instead of split('.')[0] foreach test_dict : tests
# test_name = fs.replace_suffix(source, '') # The test_name is the name of the source file without the file suffix'.
# The test_name is the name of the source file without the file suffix. source = test_dict['source'][0]
test_name = source.split('.')[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] test_deps = [thread_dep, test_fixtures]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment