Skip to content

Commit

Permalink
test: use pytest with xdist where available
Browse files Browse the repository at this point in the history
  • Loading branch information
whot committed May 16, 2024
1 parent 918f837 commit 2e28364
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ if get_option('tests').enabled()
env.set('LD_LIBRARY_PATH', fs.parent(lib_libwacom.full_path()))
pymod.find_installation(modules: ['libevdev', 'pyudev', 'pytest'])
pytest = find_program('pytest-3', 'pytest')
pytest_args = ['--verbose', '--log-level=DEBUG']
# pytest xdist is nice because it significantly speeds up our
# test process, but it's not required
if pymod.find_installation('python3', modules: ['xdist'], required: false).found()
pytest_args += ['-n', 'auto']
endif
pytest_files = [
'test_data_files.py',
'test_libwacom.py',
Expand All @@ -301,7 +307,7 @@ if get_option('tests').enabled()
foreach f: pytest_files
test('pytest @0@'.format(f),
pytest,
args: ['--verbose', '--log-level=DEBUG', meson.current_source_dir() / 'test' / f],
args: pytest_args + [meson.current_source_dir() / 'test' / f],
env: env,
suite: ['all'])
endforeach
Expand Down

0 comments on commit 2e28364

Please sign in to comment.