From 75f8d2a1d1bf7375b11f29981b98617906618f1a Mon Sep 17 00:00:00 2001 From: Fritz Reichwald Date: Wed, 12 Apr 2017 06:52:26 +0200 Subject: [PATCH] Test if stdin gets closed when starting QProcess --- tests/end2end/data/userscripts/test_stdinclose.py | 7 +++++++ tests/end2end/features/spawn.feature | 5 +++++ 2 files changed, 12 insertions(+) create mode 100755 tests/end2end/data/userscripts/test_stdinclose.py diff --git a/tests/end2end/data/userscripts/test_stdinclose.py b/tests/end2end/data/userscripts/test_stdinclose.py new file mode 100755 index 000000000..f3f4e4545 --- /dev/null +++ b/tests/end2end/data/userscripts/test_stdinclose.py @@ -0,0 +1,7 @@ +#!/usr/bin/python3 + +import sys +import os +sys.stdin.read() +with open(os.environ['QUTE_FIFO'], 'wb') as fifo: + fifo.write(b':message-info "stdin closed"\n') diff --git a/tests/end2end/features/spawn.feature b/tests/end2end/features/spawn.feature index 8e3f88bd1..f5108b9e7 100644 --- a/tests/end2end/features/spawn.feature +++ b/tests/end2end/features/spawn.feature @@ -55,3 +55,8 @@ Feature: :spawn Then the following tabs should be open: - about:blank - about:blank (active) + + Scenario: Running :spawn with userscript that expects the stdin getting closed + When I open about:blank + And I run :spawn -u (testdata)/userscripts/test_stdinclose.py + Then "stdin closed" should be logged