testsuite: Better test of --tty.

This commit is contained in:
Ole Tange 2015-03-08 10:37:49 +01:00
parent 0b99f96151
commit 32b6dc4ba5
3 changed files with 34 additions and 1 deletions

View file

@ -1052,7 +1052,7 @@ sub parse_options {
sub init_globals {
# Defaults:
$Global::version = 20150306;
$Global::version = 20150307;
$Global::progname = 'parallel';
$Global::infinity = 2**31;
$Global::debug = 0;

View file

@ -22,4 +22,16 @@ echo via pseudotty | script -q -f -c /tmp/parallel-script-for-script2 /dev/null
sleep 2
rm /tmp/parallel-script-for-script2
echo "### Test stdin as tty input for 'vi'"
echo 'NB: If this changes and the diff is printed to terminal, then'
echo "the terminal settings may be fucked up. Use 'reset' to get back."
cat >/tmp/parallel-script-for-script3 <<EOF
#!/bin/bash
seq 10 | parallel --tty -X vi file{}
EOF
chmod 755 /tmp/parallel-script-for-script3
echo ZZZZ | script -q -f -c /tmp/parallel-script-for-script3 /dev/null
sleep 2
rm /tmp/parallel-script-for-script3
touch ~/.parallel/will-cite

View file

@ -14,7 +14,9 @@ Silence the citation notice: run 'parallel --bibtex' once or use '--will-cite'.
cat -
via first cat
cat -
cat -
via pseudotty
cat -
### Test stdin goes to first command only ("cat" as argument)
Academic tradition requires you to cite works you base your article on.
When using programs that use GNU Parallel to process data for publication
@ -30,5 +32,24 @@ Silence the citation notice: run 'parallel --bibtex' once or use '--will-cite'.
echo a
a
echo a
cat
via pseudotty
cat
### Test stdin as tty input for 'vi'
NB: If this changes and the diff is printed to terminal, then
the terminal settings may be fucked up. Use 'reset' to get back.
Academic tradition requires you to cite works you base your article on.
When using programs that use GNU Parallel to process data for publication
please cite:
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
;login: The USENIX Magazine, February 2011:42-47.
This helps funding further development; and it won't cost you a cent.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.
Silence the citation notice: run 'parallel --bibtex' once or use '--will-cite'.
10 files to edit
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"file1" [New File]~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ [?12l[?25h[?25lE173: 9 more files to edit[?12l[?25h[?1l>[?1049l