Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions btest
Original file line number Diff line number Diff line change
Expand Up @@ -3041,6 +3041,9 @@ def parse_options():
warning("ignoring requested parallelism in interactive-update mode")
options.threads = 1

if options.mode == "UPDATE_INTERACTIVE" and not sys.stdout.isatty():
error("interactive-update mode must have a TTY")

return options, parsed_args


Expand Down
2 changes: 2 additions & 0 deletions testing/Baseline/tests.update-interactive-requires-tty/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
interactive-update mode must have a TTY
8 changes: 8 additions & 0 deletions testing/tests/update-interactive-requires-tty.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# %TEST-DOC: --update-interactive errors out early when stdout is not a TTY.
#
# Running btest inside btest redirects the inner stdout, so it is not a
# TTY and the guard must fire before any test would prompt for input.
# %TEST-EXEC-FAIL: btest -u . >output 2>&1
# %TEST-EXEC: btest-diff output

@TEST-EXEC: exit 1
Loading