Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fg and bg tests
- X-seq: zsh-workers 42713
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh hackers' list <zsh-workers@xxxxxxx>
- Subject: PATCH: fg and bg tests
- Date: Tue, 24 Apr 2018 13:59:44 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180424125947euoutp01680ecd9f5f1bbf6cf59ea68602c77fa6~oYLEUIKtW0196901969euoutp017
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1524574787; bh=ITHvXH46EnkA7Qpmo/ebjuhYWk3Y7Fk7bVuQQD9a3Ig=; h=Date:From:To:Subject:References:From; b=PNGdz1e63G32atPFURMfVwT7lHyiZasXeNG4cAypUGAvPJKq1E5/yxqaBwM7RxbAv K+/AMXqHLaotwotvvKVa3JWSdUxw9bfnUC5KHnagMO5CqjXwV8Vx5uC1pgt3mG+VfM 2Qzq9DVcAmrd93Zgg+jxgIJ8shPLw4J58uy8dNkU=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180424125946eucas1p1f04c37866bb05e4a72edf4259af38238@eucas1p1.samsung.com>
Here's a way of testing fg and bg. See if you can spot any problems
before the tests become too hairy to debug.
The time waiting for the ^z is already there in previous tests ---
nobody's apparently noticed any problems there. Maybe we can avoid
them all with carefully chosen output, but I don't think it's trivial.
pws
diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst
index 65b8600..43f2c4d 100644
--- a/Test/W02jobs.ztst
+++ b/Test/W02jobs.ztst
@@ -181,6 +181,50 @@
*>\[2] ? interrupt*sleep*
*>\[1] ? kill*sleep*
+ zpty_start
+ zpty_input 'ed 2>/dev/null'
+ zpty_input $'a\nstuff1\n.\nw tmpfile\nq\n'
+ zpty_stop
+ cat tmpfile
+ rm -f tmpfile
+0:Sanity check of "ed" as foreground process
+>stuff1
+F:This test checks we can run the simple editor "ed" as a way of testing
+F:user interaction for later job control tests . The test itself is
+F:trivial; its failure may simply indicate our test methodology does not
+F:work on this system.
+
+ zpty_start
+ zpty_input 'ed 2>/dev/null'
+ sleep 0.1
+ zpty_input $'\C-z'
+ zpty_input 'fg'
+ zpty_input $'a\nstuff2\n.\nw tmpfile\nq\n'
+ zpty_stop
+ cat tmpfile
+ rm -f tmpfile
+0:Basic fg with subsequent user interaction
+*>zsh:*(stopped|suspended)*ed*
+*>*continued*ed*
+*>stuff2
+
+ zpty_start
+ zpty_input 'ed 2>/dev/null'
+ sleep 0.1
+ zpty_input $'\C-z'
+ zpty_input 'bg'
+ zpty_input 'fg'
+ zpty_input $'a\nstuff3\n.\nw tmpfile\nq\n'
+ zpty_stop
+ cat tmpfile
+ rm -f tmpfile
+0:bg and fg with user input
+*>zsh:*(stopped|suspended)*ed*
+*>*continued*ed*
+*>*(stopped|suspended)*ed*
+*>*continued*ed*
+*>stuff3
+
%clean
zmodload -ui zsh/zpty
Messages sorted by:
Reverse Date,
Date,
Thread,
Author