Skip to content

Commit fa13c02

Browse files
tests: passthrough meson --test-args to pytest
Currently, to my knowledge, there is no way to filter tests when running the testsuite through meson. Manually invoking pytest is the only way. This PR allows such CLI invocation to be possible to filter tests containing "recovery": meson test -C obj --test-args="-k recovery" Signed-off-by: Khang D Nguyen <khangng@os.amperecomputing.com>
1 parent e7c87ba commit fa13c02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ if tests
124124
# redirecting to a file. We can detect this if stdout is an terminal, and
125125
# disable TAP protocol.
126126
pytest = find_program('pytest')
127-
script = '''export DBUS_STARTER_BUS_TYPE=user; if [ ! -t 1 ]; then PYTEST_FLAGS="--tap"; fi; @0@ $PYTEST_FLAGS'''.format(pytest.full_path())
127+
script = '''export DBUS_STARTER_BUS_TYPE=user; if [ ! -t 1 ]; then PYTEST_FLAGS="--tap"; fi; @0@ $PYTEST_FLAGS $@'''.format(pytest.full_path())
128128
sh = find_program('sh')
129129
dbus_run_session = find_program('dbus-run-session')
130130

@@ -140,7 +140,7 @@ if tests
140140

141141
test('test-mctpd', dbus_run_session,
142142
depends: mctpd_test,
143-
args: [ sh.full_path(), '-c', script ],
143+
args: [ sh.full_path(), '-c', script, '--' ],
144144
protocol: 'tap',
145145
)
146146
endif

0 commit comments

Comments
 (0)