Skip to content

Commit

Permalink
build: Split tests into integration and unit tests
Browse files Browse the repository at this point in the history
Instead of seperating them on the fact that some are C and some are
python, seperate them by what kind of tests they are.

In this case, all C tests are unit tests and all pytest tests are
integration tests.
  • Loading branch information
swick authored and GeorgesStavracas committed Feb 4, 2025
1 parent 005da4c commit e8a7a43
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ test_permission_db = executable(
install_dir: installed_tests_dir,
)
test(
'test-permission-db',
'unit/permission-db',
test_permission_db,
suite: ['unit'],
env: env_tests,
is_parallel: false,
protocol: test_protocol,
Expand All @@ -38,8 +39,9 @@ test_xdp_utils = executable(
install_dir: installed_tests_dir,
)
test(
'test-xdp-utils',
'unit/xdp-utils',
test_xdp_utils,
suite: ['unit'],
env: env_tests,
is_parallel: false,
protocol: test_protocol,
Expand All @@ -55,8 +57,9 @@ test_method_info = executable(
install_dir: installed_tests_dir,
)
test(
'test-xdp-method-info',
'unit/xdp-method-info',
test_method_info,
suite: ['unit'],
env: env_tests,
is_parallel: true,
protocol: test_protocol,
Expand Down Expand Up @@ -131,13 +134,13 @@ template_files = [
]

foreach pytest_file : pytest_files
testname = pytest_file.replace('.py', '')
testname = pytest_file.replace('.py', '').replace('test_', '')
test(
'pytest/@0@'.format(testname),
'integration/@0@'.format(testname),
pytest,
args: [meson.current_source_dir()] + pytest_args + ['-k', testname],
env: pytest_env,
suite: ['pytest'],
suite: ['integration'],
timeout: 120,
)
endforeach
Expand Down Expand Up @@ -167,7 +170,7 @@ if enable_installed_tests
endforeach

foreach pytest_file : pytest_files
testname = pytest_file.replace('.py', '')
testname = pytest_file.replace('.py', '').replace('test_', '')

exec = [pytest.full_path(), installed_tests_dir / 'tests' / pytest_file]
exec += pytest_args
Expand All @@ -181,7 +184,7 @@ if enable_installed_tests

configure_file(
input: 'template.test.in',
output: '@[email protected]'.format(testname),
output: 'integration-@[email protected]'.format(testname),
configuration: data,
install: true,
install_dir: installed_tests_data_dir,
Expand Down

0 comments on commit e8a7a43

Please sign in to comment.