Skip to content

Commit 380608e

Browse files
committed
Merge branch 'pr/79'
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 parents b2463e1 + fa13c02 commit 380608e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,13 @@ if tests
118118
# Invoke pytest via a shell script under `dbus-run-session` so we can
119119
# override the sanitation of `DBUS_STARTER_BUS_TYPE`, ensuring `test-mctpd`
120120
# connects to the isolated session bus prepared by `dbus-run-session`.
121+
#
122+
# On newer meson versions, we can use meson test -C build --interactive
123+
# to allow pytest to print output directly onto the terminal without
124+
# redirecting to a file. We can detect this if stdout is an terminal, and
125+
# disable TAP protocol.
121126
pytest = find_program('pytest')
122-
script = 'export DBUS_STARTER_BUS_TYPE=user ; @0@ --tap'.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())
123128
sh = find_program('sh')
124129
dbus_run_session = find_program('dbus-run-session')
125130

@@ -135,7 +140,7 @@ if tests
135140

136141
test('test-mctpd', dbus_run_session,
137142
depends: mctpd_test,
138-
args: [ sh.full_path(), '-c', script ],
143+
args: [ sh.full_path(), '-c', script, '--' ],
139144
protocol: 'tap',
140145
)
141146
endif

tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ pyroute2==0.7.10
33
pytest==8.3.2
44
pytest-trio==0.8.0
55
trio==0.26.2
6-
pytest-tap==3.4
6+
pytest-tap==3.5

0 commit comments

Comments
 (0)