zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh hackers' list <zsh-workers@zsh.org>
Subject: PATCH: fg and bg tests
Date: Tue, 24 Apr 2018 13:59:44 +0100	[thread overview]
Message-ID: <20180424135944.64e73c62@camnpupstephen.cam.scsc.local> (raw)
In-Reply-To: <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


       reply	other threads:[~2018-04-24 12:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180424125946eucas1p1f04c37866bb05e4a72edf4259af38238@eucas1p1.samsung.com>
2018-04-24 12:59 ` Peter Stephenson [this message]
     [not found]   ` <CGME20180425090941eucas1p187cf5d07341d2041c15e9947962f3bd9@eucas1p1.samsung.com>
2018-04-25  9:09     ` Peter Stephenson
2018-04-25 10:32       ` Stephane Chazelas
2018-04-25 14:28       ` Bart Schaefer
2018-04-25 14:56         ` Peter Stephenson
2018-04-25 17:01           ` Peter Stephenson
2018-04-25 17:16             ` Bart Schaefer
2018-04-25 17:41               ` Peter Stephenson
2018-04-25 17:55                 ` Bart Schaefer
2018-04-26  8:08                   ` Peter Stephenson
2018-04-26 14:37                     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180424135944.64e73c62@camnpupstephen.cam.scsc.local \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).