summaryrefslogtreecommitdiffabout
path: root/t
authorSergey Poznyakoff <gray@gnu.org>2017-08-19 17:24:59 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2017-08-19 17:28:40 (GMT)
commitde5b0a9c0265b329b0c67cb02381fe7aebfd5186 (patch) (unidiff)
treef8462d313b327c6d3ace6445777e09de862eb8af /t
parent511f9c9765eb2a9992ea4470703ebcd96faca52b (diff)
downloadruncap-de5b0a9c0265b329b0c67cb02381fe7aebfd5186.tar.gz
runcap-de5b0a9c0265b329b0c67cb02381fe7aebfd5186.tar.bz2
Rewrite testsuite in autotest. Fix distcheck
Diffstat (limited to 't') (more/less context) (ignore whitespace changes)
-rw-r--r--t/.gitignore4
-rwxr-xr-xt/06mon.t101
-rwxr-xr-xt/07mon.t101
-rw-r--r--t/Makefile.am82
-rw-r--r--t/atlocal.in6
-rw-r--r--t/linemon00.at98
-rw-r--r--t/linemon01.at98
-rw-r--r--[-rwxr-xr-x]t/lines.at (renamed from t/01lines.t)18
-rw-r--r--[-rwxr-xr-x]t/longout.at (renamed from t/03longout.t)19
-rw-r--r--[-rwxr-xr-x]t/pipe.at (renamed from t/04stdin.t)18
-rw-r--r--t/rt.c14
-rw-r--r--[-rwxr-xr-x]t/seek00.at (renamed from t/08seek.t)26
-rw-r--r--[-rwxr-xr-x]t/seek01.at (renamed from t/09seek.t)28
-rw-r--r--[-rwxr-xr-x]t/simple.at (copied from t/00simple.t)21
-rw-r--r--[-rwxr-xr-x]t/stdin.at (renamed from t/05stdin.t)18
-rwxr-xr-xt/testsuite139
-rw-r--r--[-rwxr-xr-x]t/testsuite.at (renamed from t/00simple.t)26
-rw-r--r--[-rwxr-xr-x]t/two.at (renamed from t/02two.t)19
18 files changed, 374 insertions, 462 deletions
diff --git a/t/.gitignore b/t/.gitignore
index bb11f3b..64c47ea 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -1,4 +1,8 @@
1/testsuite
1/testsuite.dir 2/testsuite.dir
2/testsuite.log 3/testsuite.log
3/rt 4/rt
4/genout 5/genout
6/atconfig
7/atlocal
8/package.m4
diff --git a/t/06mon.t b/t/06mon.t
deleted file mode 100755
index 4ff3dac..0000000
--- a/t/06mon.t
+++ b/dev/null
@@ -1,101 +0,0 @@
1#! ./testsuite
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff
4#
5# Runcap is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 3 of the License, or (at your
8# option) any later version.
9#
10# Runcap is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17
18TC_TITLE line monitor
19
20TC_EXPECT out <<EOT
21[stdout]: CHAPTER I. Down the Rabbit-Hole
22[stdout]:
23[stdout]: Alice was beginning to get very tired of sitting by her sister on the
24[stdout]: bank, and of having nothing to do: once or twice she had peeped into the
25[stdout]: book her sister was reading, but it had no pictures or conversations
26[stdout]: in it, 'and what is the use of a book,' thought Alice 'without
27[stdout]: pictures or conversations?'
28[stdout]:
29[stdout]: So she was considering in her own mind (as well as she could, for the
30[stdout]: hot day made her feel very sleepy and stupid), whether the pleasure of
31[stdout]: making a daisy-chain would be worth the trouble of getting up and picking
32[stdout]: the daisies, when suddenly a White Rabbit with pink eyes ran close by her.
33[stdout]:
34[stdout]: There was nothing so very remarkable in that; nor did Alice think it
35[stdout]: so very much out of the way to hear the Rabbit say to itself, 'Oh
36[stdout]: dear! Oh dear! I shall be late!' (when she thought it over afterwards,
37[stdout]: it occurred to her that she ought to have wondered at this, but at the
38[stdout]: time it all seemed quite natural); but when the Rabbit actually took a
39[stdout]: watch out of its waistcoat-pocket, and looked at it, and then hurried on,
40[stdout]: Alice started to her feet, for it flashed across her mind that she had
41[stdout]: never before seen a rabbit with either a waistcoat-pocket, or a watch
42[stdout]: to take out of it, and burning with curiosity, she ran across the field
43[stdout]: after it, and fortunately was just in time to see it pop down a large
44[stdout]: rabbit-hole under the hedge.
45[stdout]:
46[stdout]: In another moment down went Alice after it, never once considering how
47[stdout]: in the world she was to get out again.
48[stdout]:
49[stdout]: The rabbit-hole went straight on like a tunnel for some way, and then
50[stdout]: dipped suddenly down, so suddenly that Alice had not a moment to think
51[stdout]: about stopping herself before she found herself falling down a very
52[stdout]: deep well.
53[stdout]:
54[stdout]: Either the well was very deep, or she fell very slowly, for she had plenty
55[stdout]: of time as she went down to look about her and to wonder what was going
56[stdout]: to happen next. First, she tried to look down and make out what she was
57[stdout]: coming to, but it was too dark to see anything; then she looked at the
58[stdout]: sides of the well, and noticed that they were filled with cupboards
59[stdout]: and book-shelves; here and there she saw maps and pictures hung upon
60[stdout]: pegs. She took down a jar from one of the shelves as she passed; it was
61[stdout]: labelled 'ORANGE MARMALADE', but to her great disappointment it was
62[stdout]: empty: she did not like to drop the jar for fear of killing somebody,
63[stdout]: so managed to put it into one of the cupboards as she fell past it.
64[stdout]:
65[stdout]: 'Well!' thought Alice to herself, 'after such a fall as this,
66[stdout]: I shall think nothing of tumbling down stairs! How brave they'll all
67[stdout]: think me at home! Why, I wouldn't say anything about it, even if I
68[stdout]: fell off the top of the house!' (Which was very likely true.)
69[stdout]:
70[stdout]: Down, down, down. Would the fall never come to an end! 'I wonder how
71[stdout]: many miles I've fallen by this time?' she said aloud. 'I must be
72[stdout]: getting somewhere near the centre of the earth. Let me see: that would be
73[stdout]: four thousand miles down, I think--' (for, you see, Alice had learnt
74[stdout]: several things of this sort in her lessons in the schoolroom, and though
75[stdout]: this was not a very good opportunity for showing off her knowledge,
76[stdout]: as there was no one to listen to her, still it was good practice to
77[stdout]: say it over) '--yes, that's about the right distance--but then I
78[stdout]: wonder what Latitude or Longitude I've got to?' (Alice had no idea
79[stdout]: what Latitude was, or Longitude either, but thought they were nice grand
80[stdout]: words to say.)
81[stdout]:
82[stdout]: Presently she began again. 'I wonder if I shall fall right through
83[stdout]: the earth! How funny it'll seem to come out among the people that
84[stdout]: walk with their heads downward! The Antipathies, I think--' (she was
85[stdout]: rather glad there was no one listening, this time, as it didn't sound
86[stdout]: at all the right word) '--but I shall have to ask them what the name
87[stdout]: of the country is, you know. Please, Ma'am, is this New Zealand or
88[stdout]: Australia?' (and she tried to curtsey as she spoke--fancy curtseying
89[stdout]: as you're falling through the air! Do you think you could manage
90[stdout]: it?) 'And what an ignorant little girl she'll think me for asking! No,
91[stdout]: it'll never do to ask: perhaps I shall see it written up somewhere.'
92res=0
93exit code: 0
94stdout: 71 lines, 4051 bytes
95stderr: 0 lines, 0 bytes
96EOT
97
98rt -m -- genout $testdir/INPUT
99
100
101
diff --git a/t/07mon.t b/t/07mon.t
deleted file mode 100755
index 4224f87..0000000
--- a/t/07mon.t
+++ b/dev/null
@@ -1,101 +0,0 @@
1#! ./testsuite
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff
4#
5# Runcap is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 3 of the License, or (at your
8# option) any later version.
9#
10# Runcap is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17
18TC_TITLE line monitor, short buffer
19
20TC_EXPECT out <<EOT
21[stdout]: CHAPTER I. Down the Rabbit-Hole
22[stdout]:
23[stdout]: Alice was beginning to get very tired of sitting by her sister on the
24[stdout]: bank, and of having nothing to do: once or twice she had peeped into the
25[stdout]: book her sister was reading, but it had no pictures or conversations
26[stdout]: in it, 'and what is the use of a book,' thought Alice 'without
27[stdout]: pictures or conversations?'
28[stdout]:
29[stdout]: So she was considering in her own mind (as well as she could, for the
30[stdout]: hot day made her feel very sleepy and stupid), whether the pleasure of
31[stdout]: making a daisy-chain would be worth the trouble of getting up and picking
32[stdout]: the daisies, when suddenly a White Rabbit with pink eyes ran close by her.
33[stdout]:
34[stdout]: There was nothing so very remarkable in that; nor did Alice think it
35[stdout]: so very much out of the way to hear the Rabbit say to itself, 'Oh
36[stdout]: dear! Oh dear! I shall be late!' (when she thought it over afterwards,
37[stdout]: it occurred to her that she ought to have wondered at this, but at the
38[stdout]: time it all seemed quite natural); but when the Rabbit actually took a
39[stdout]: watch out of its waistcoat-pocket, and looked at it, and then hurried on,
40[stdout]: Alice started to her feet, for it flashed across her mind that she had
41[stdout]: never before seen a rabbit with either a waistcoat-pocket, or a watch
42[stdout]: to take out of it, and burning with curiosity, she ran across the field
43[stdout]: after it, and fortunately was just in time to see it pop down a large
44[stdout]: rabbit-hole under the hedge.
45[stdout]:
46[stdout]: In another moment down went Alice after it, never once considering how
47[stdout]: in the world she was to get out again.
48[stdout]:
49[stdout]: The rabbit-hole went straight on like a tunnel for some way, and then
50[stdout]: dipped suddenly down, so suddenly that Alice had not a moment to think
51[stdout]: about stopping herself before she found herself falling down a very
52[stdout]: deep well.
53[stdout]:
54[stdout]: Either the well was very deep, or she fell very slowly, for she had plenty
55[stdout]: of time as she went down to look about her and to wonder what was going
56[stdout]: to happen next. First, she tried to look down and make out what she was
57[stdout]: coming to, but it was too dark to see anything; then she looked at the
58[stdout]: sides of the well, and noticed that they were filled with cupboards
59[stdout]: and book-shelves; here and there she saw maps and pictures hung upon
60[stdout]: pegs. She took down a jar from one of the shelves as she passed; it was
61[stdout]: labelled 'ORANGE MARMALADE', but to her great disappointment it was
62[stdout]: empty: she did not like to drop the jar for fear of killing somebody,
63[stdout]: so managed to put it into one of the cupboards as she fell past it.
64[stdout]:
65[stdout]: 'Well!' thought Alice to herself, 'after such a fall as this,
66[stdout]: I shall think nothing of tumbling down stairs! How brave they'll all
67[stdout]: think me at home! Why, I wouldn't say anything about it, even if I
68[stdout]: fell off the top of the house!' (Which was very likely true.)
69[stdout]:
70[stdout]: Down, down, down. Would the fall never come to an end! 'I wonder how
71[stdout]: many miles I've fallen by this time?' she said aloud. 'I must be
72[stdout]: getting somewhere near the centre of the earth. Let me see: that would be
73[stdout]: four thousand miles down, I think--' (for, you see, Alice had learnt
74[stdout]: several things of this sort in her lessons in the schoolroom, and though
75[stdout]: this was not a very good opportunity for showing off her knowledge,
76[stdout]: as there was no one to listen to her, still it was good practice to
77[stdout]: say it over) '--yes, that's about the right distance--but then I
78[stdout]: wonder what Latitude or Longitude I've got to?' (Alice had no idea
79[stdout]: what Latitude was, or Longitude either, but thought they were nice grand
80[stdout]: words to say.)
81[stdout]:
82[stdout]: Presently she began again. 'I wonder if I shall fall right through
83[stdout]: the earth! How funny it'll seem to come out among the people that
84[stdout]: walk with their heads downward! The Antipathies, I think--' (she was
85[stdout]: rather glad there was no one listening, this time, as it didn't sound
86[stdout]: at all the right word) '--but I shall have to ask them what the name
87[stdout]: of the country is, you know. Please, Ma'am, is this New Zealand or
88[stdout]: Australia?' (and she tried to curtsey as she spoke--fancy curtseying
89[stdout]: as you're falling through the air! Do you think you could manage
90[stdout]: it?) 'And what an ignorant little girl she'll think me for asking! No,
91[stdout]: it'll never do to ask: perhaps I shall see it written up somewhere.'
92res=0
93exit code: 0
94stdout: 71 lines, 4051 bytes
95stderr: 0 lines, 0 bytes
96EOT
97
98rt -s 16 -m -- genout $testdir/INPUT
99
100
101
diff --git a/t/Makefile.am b/t/Makefile.am
index 681184f..b41aa20 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -1,4 +1,4 @@
1# runcap - run program and capture its output 1# This file is part of runcap testsuite.
2# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
3# 3#
4# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -14,28 +14,74 @@
14# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
15# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
16 16
17TESTPROGS=genout rt 17EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 INPUT
18check: $(TESTPROGS) 18DISTCLEANFILES = atconfig $(check_SCRIPTS)
19 @$(srcdir)/testsuite 19MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
20CLEANFILES = .TESTINIT FAILURE
21
22## ------------ ##
23## package.m4. ##
24## ------------ ##
25
26$(srcdir)/package.m4: $(top_srcdir)/configure.ac
27 $(AM_V_GEN){ \
28 echo '# Signature of the current package.'; \
29 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
30 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
31 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
32 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
33 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
34 } >$(srcdir)/package.m4
35
36#
37
38## ------------ ##
39## Test suite. ##
40## ------------ ##
41
42TESTSUITE_AT = \
43 testsuite.at\
44 simple.at\
45 lines.at\
46 two.at\
47 longout.at\
48 stdin.at\
49 pipe.at\
50 linemon00.at\
51 linemon01.at\
52 seek00.at\
53 seek01.at
54# Add more files here
55
56TESTSUITE = $(srcdir)/testsuite
57M4=m4
58
59AUTOTEST = $(AUTOM4TE) --language=autotest
60$(TESTSUITE): package.m4 $(TESTSUITE_AT)
61 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
62 $(AM_V_at)mv $@.tmp $@
63
64atconfig: $(top_builddir)/config.status
65 @cd $(top_builddir) && ./config.status tests/$@
66
67clean-local:
68 @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
69
70check-local: atconfig atlocal $(TESTSUITE)
71 @$(SHELL) $(TESTSUITE)
72
73# Run the test suite on the *installed* tree.
74#installcheck-local:
75 #$(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
20 76
21AM_CPPFLAGS=@RUNCAP_INC@ 77AM_CPPFLAGS=@RUNCAP_INC@
22 78
23noinst_PROGRAMS = rt genout 79noinst_PROGRAMS = rt genout
24rt_SOURCES=rt.c 80rt_SOURCES=rt.c
25rt_LDADD=../libruncap.a 81rt_LDADD=@RUNCAP_LDADD@
26 82
27genout_SOURCES = genout.c 83genout_SOURCES = genout.c
28 84
29TESTSUITE =\ 85
30 testsuite\ 86
31 00simple.t\ 87
32 01lines.t\
33 02two.t\
34 03longout.t\
35 04stdin.t\
36 05stdin.t\
37 06mon.t\
38 08seek.t\
39 09seek.t
40
41EXTRA_DIST = $(TESTSUITE) INPUT
diff --git a/t/atlocal.in b/t/atlocal.in
new file mode 100644
index 0000000..1c524f5
--- a/dev/null
+++ b/t/atlocal.in
@@ -0,0 +1,6 @@
1# @configure_input@ -*- shell-script -*-
2# Configurable variable values for runcap test suite.
3# Copyright (C) 2017 Sergey Poznyakoff
4
5PATH=@abs_builddir@:@abs_top_srcdir@:$top_srcdir:$srcdir:$PATH
6INPUT=@abs_top_srcdir@/t/INPUT
diff --git a/t/linemon00.at b/t/linemon00.at
new file mode 100644
index 0000000..7310040
--- a/dev/null
+++ b/t/linemon00.at
@@ -0,0 +1,98 @@
1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# Copyright (C) 2017 Sergey Poznyakoff
3#
4# Runcap is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the
6# Free Software Foundation; either version 3 of the License, or (at your
7# option) any later version.
8#
9# Runcap is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
16
17AT_SETUP([line monitor])
18AT_KEYWORDS([linemon monitor])
19AT_CHECK([rt -m -- genout $INPUT
20],
21[0],
22[stdout: CHAPTER I. Down the Rabbit-Hole
23stdout:
24stdout: Alice was beginning to get very tired of sitting by her sister on the
25stdout: bank, and of having nothing to do: once or twice she had peeped into the
26stdout: book her sister was reading, but it had no pictures or conversations
27stdout: in it, 'and what is the use of a book,' thought Alice 'without
28stdout: pictures or conversations?'
29stdout:
30stdout: So she was considering in her own mind (as well as she could, for the
31stdout: hot day made her feel very sleepy and stupid), whether the pleasure of
32stdout: making a daisy-chain would be worth the trouble of getting up and picking
33stdout: the daisies, when suddenly a White Rabbit with pink eyes ran close by her.
34stdout:
35stdout: There was nothing so very remarkable in that; nor did Alice think it
36stdout: so very much out of the way to hear the Rabbit say to itself, 'Oh
37stdout: dear! Oh dear! I shall be late!' (when she thought it over afterwards,
38stdout: it occurred to her that she ought to have wondered at this, but at the
39stdout: time it all seemed quite natural); but when the Rabbit actually took a
40stdout: watch out of its waistcoat-pocket, and looked at it, and then hurried on,
41stdout: Alice started to her feet, for it flashed across her mind that she had
42stdout: never before seen a rabbit with either a waistcoat-pocket, or a watch
43stdout: to take out of it, and burning with curiosity, she ran across the field
44stdout: after it, and fortunately was just in time to see it pop down a large
45stdout: rabbit-hole under the hedge.
46stdout:
47stdout: In another moment down went Alice after it, never once considering how
48stdout: in the world she was to get out again.
49stdout:
50stdout: The rabbit-hole went straight on like a tunnel for some way, and then
51stdout: dipped suddenly down, so suddenly that Alice had not a moment to think
52stdout: about stopping herself before she found herself falling down a very
53stdout: deep well.
54stdout:
55stdout: Either the well was very deep, or she fell very slowly, for she had plenty
56stdout: of time as she went down to look about her and to wonder what was going
57stdout: to happen next. First, she tried to look down and make out what she was
58stdout: coming to, but it was too dark to see anything; then she looked at the
59stdout: sides of the well, and noticed that they were filled with cupboards
60stdout: and book-shelves; here and there she saw maps and pictures hung upon
61stdout: pegs. She took down a jar from one of the shelves as she passed; it was
62stdout: labelled 'ORANGE MARMALADE', but to her great disappointment it was
63stdout: empty: she did not like to drop the jar for fear of killing somebody,
64stdout: so managed to put it into one of the cupboards as she fell past it.
65stdout:
66stdout: 'Well!' thought Alice to herself, 'after such a fall as this,
67stdout: I shall think nothing of tumbling down stairs! How brave they'll all
68stdout: think me at home! Why, I wouldn't say anything about it, even if I
69stdout: fell off the top of the house!' (Which was very likely true.)
70stdout:
71stdout: Down, down, down. Would the fall never come to an end! 'I wonder how
72stdout: many miles I've fallen by this time?' she said aloud. 'I must be
73stdout: getting somewhere near the centre of the earth. Let me see: that would be
74stdout: four thousand miles down, I think--' (for, you see, Alice had learnt
75stdout: several things of this sort in her lessons in the schoolroom, and though
76stdout: this was not a very good opportunity for showing off her knowledge,
77stdout: as there was no one to listen to her, still it was good practice to
78stdout: say it over) '--yes, that's about the right distance--but then I
79stdout: wonder what Latitude or Longitude I've got to?' (Alice had no idea
80stdout: what Latitude was, or Longitude either, but thought they were nice grand
81stdout: words to say.)
82stdout:
83stdout: Presently she began again. 'I wonder if I shall fall right through
84stdout: the earth! How funny it'll seem to come out among the people that
85stdout: walk with their heads downward! The Antipathies, I think--' (she was
86stdout: rather glad there was no one listening, this time, as it didn't sound
87stdout: at all the right word) '--but I shall have to ask them what the name
88stdout: of the country is, you know. Please, Ma'am, is this New Zealand or
89stdout: Australia?' (and she tried to curtsey as she spoke--fancy curtseying
90stdout: as you're falling through the air! Do you think you could manage
91stdout: it?) 'And what an ignorant little girl she'll think me for asking! No,
92stdout: it'll never do to ask: perhaps I shall see it written up somewhere.'
93res=0
94exit code: 0
95stdout: 71 lines, 4051 bytes
96stderr: 0 lines, 0 bytes
97])
98AT_CLEANUP
diff --git a/t/linemon01.at b/t/linemon01.at
new file mode 100644
index 0000000..f3249a0
--- a/dev/null
+++ b/t/linemon01.at
@@ -0,0 +1,98 @@
1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# Copyright (C) 2017 Sergey Poznyakoff
3#
4# Runcap is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the
6# Free Software Foundation; either version 3 of the License, or (at your
7# option) any later version.
8#
9# Runcap is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
16
17AT_SETUP([line monitor, short buffer])
18AT_KEYWORDS([linemon linemon01.at])
19AT_CHECK([rt -s 16 -m -- genout $INPUT
20],
21[0],
22[stdout: CHAPTER I. Down the Rabbit-Hole
23stdout:
24stdout: Alice was beginning to get very tired of sitting by her sister on the
25stdout: bank, and of having nothing to do: once or twice she had peeped into the
26stdout: book her sister was reading, but it had no pictures or conversations
27stdout: in it, 'and what is the use of a book,' thought Alice 'without
28stdout: pictures or conversations?'
29stdout:
30stdout: So she was considering in her own mind (as well as she could, for the
31stdout: hot day made her feel very sleepy and stupid), whether the pleasure of
32stdout: making a daisy-chain would be worth the trouble of getting up and picking
33stdout: the daisies, when suddenly a White Rabbit with pink eyes ran close by her.
34stdout:
35stdout: There was nothing so very remarkable in that; nor did Alice think it
36stdout: so very much out of the way to hear the Rabbit say to itself, 'Oh
37stdout: dear! Oh dear! I shall be late!' (when she thought it over afterwards,
38stdout: it occurred to her that she ought to have wondered at this, but at the
39stdout: time it all seemed quite natural); but when the Rabbit actually took a
40stdout: watch out of its waistcoat-pocket, and looked at it, and then hurried on,
41stdout: Alice started to her feet, for it flashed across her mind that she had
42stdout: never before seen a rabbit with either a waistcoat-pocket, or a watch
43stdout: to take out of it, and burning with curiosity, she ran across the field
44stdout: after it, and fortunately was just in time to see it pop down a large
45stdout: rabbit-hole under the hedge.
46stdout:
47stdout: In another moment down went Alice after it, never once considering how
48stdout: in the world she was to get out again.
49stdout:
50stdout: The rabbit-hole went straight on like a tunnel for some way, and then
51stdout: dipped suddenly down, so suddenly that Alice had not a moment to think
52stdout: about stopping herself before she found herself falling down a very
53stdout: deep well.
54stdout:
55stdout: Either the well was very deep, or she fell very slowly, for she had plenty
56stdout: of time as she went down to look about her and to wonder what was going
57stdout: to happen next. First, she tried to look down and make out what she was
58stdout: coming to, but it was too dark to see anything; then she looked at the
59stdout: sides of the well, and noticed that they were filled with cupboards
60stdout: and book-shelves; here and there she saw maps and pictures hung upon
61stdout: pegs. She took down a jar from one of the shelves as she passed; it was
62stdout: labelled 'ORANGE MARMALADE', but to her great disappointment it was
63stdout: empty: she did not like to drop the jar for fear of killing somebody,
64stdout: so managed to put it into one of the cupboards as she fell past it.
65stdout:
66stdout: 'Well!' thought Alice to herself, 'after such a fall as this,
67stdout: I shall think nothing of tumbling down stairs! How brave they'll all
68stdout: think me at home! Why, I wouldn't say anything about it, even if I
69stdout: fell off the top of the house!' (Which was very likely true.)
70stdout:
71stdout: Down, down, down. Would the fall never come to an end! 'I wonder how
72stdout: many miles I've fallen by this time?' she said aloud. 'I must be
73stdout: getting somewhere near the centre of the earth. Let me see: that would be
74stdout: four thousand miles down, I think--' (for, you see, Alice had learnt
75stdout: several things of this sort in her lessons in the schoolroom, and though
76stdout: this was not a very good opportunity for showing off her knowledge,
77stdout: as there was no one to listen to her, still it was good practice to
78stdout: say it over) '--yes, that's about the right distance--but then I
79stdout: wonder what Latitude or Longitude I've got to?' (Alice had no idea
80stdout: what Latitude was, or Longitude either, but thought they were nice grand
81stdout: words to say.)
82stdout:
83stdout: Presently she began again. 'I wonder if I shall fall right through
84stdout: the earth! How funny it'll seem to come out among the people that
85stdout: walk with their heads downward! The Antipathies, I think--' (she was
86stdout: rather glad there was no one listening, this time, as it didn't sound
87stdout: at all the right word) '--but I shall have to ask them what the name
88stdout: of the country is, you know. Please, Ma'am, is this New Zealand or
89stdout: Australia?' (and she tried to curtsey as she spoke--fancy curtseying
90stdout: as you're falling through the air! Do you think you could manage
91stdout: it?) 'And what an ignorant little girl she'll think me for asking! No,
92stdout: it'll never do to ask: perhaps I shall see it written up somewhere.'
93res=0
94exit code: 0
95stdout: 71 lines, 4051 bytes
96stderr: 0 lines, 0 bytes
97])
98AT_CLEANUP
diff --git a/t/01lines.t b/t/lines.at
index 0d20dcd..fde7680 100755..100644
--- a/t/01lines.t
+++ b/t/lines.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,12 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE read lines 17AT_SETUP([lines])
19 18AT_KEYWORDS([lines])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -n stdout -- genout $INPUT
21res=0 20],
21[0],
22[res=0
22exit code: 0 23exit code: 0
23stdout: 71 lines, 4051 bytes 24stdout: 71 lines, 4051 bytes
24stderr: 0 lines, 0 bytes 25stderr: 0 lines, 0 bytes
@@ -95,7 +96,6 @@ stdout listing:
95 70: it?) 'And what an ignorant little girl she'll think me for asking! No, 96 70: it?) 'And what an ignorant little girl she'll think me for asking! No,
96 71: it'll never do to ask: perhaps I shall see it written up somewhere.' 97 71: it'll never do to ask: perhaps I shall see it written up somewhere.'
97stdout listing ends 98stdout listing ends
98EOT 99])
99 100AT_CLEANUP
100rt -n stdout -- genout $testdir/INPUT
101 101
diff --git a/t/03longout.t b/t/longout.at
index 8204168..45391b2 100755..100644
--- a/t/03longout.t
+++ b/t/longout.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,12 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE file buffered output 17AT_SETUP([file buffered output])
19 18AT_KEYWORDS([longout])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -s 16 -n stdout -- genout $INPUT
21res=0 20],
21[0],
22[res=0
22exit code: 0 23exit code: 0
23stdout: 71 lines, 4051 bytes 24stdout: 71 lines, 4051 bytes
24stderr: 0 lines, 0 bytes 25stderr: 0 lines, 0 bytes
@@ -95,7 +96,5 @@ stdout listing:
95 70: it?) 'And what an ignorant little girl she'll think me for asking! No, 96 70: it?) 'And what an ignorant little girl she'll think me for asking! No,
96 71: it'll never do to ask: perhaps I shall see it written up somewhere.' 97 71: it'll never do to ask: perhaps I shall see it written up somewhere.'
97stdout listing ends 98stdout listing ends
98EOT 99])
99 100AT_CLEANUP
100rt -s 16 -n stdout -- genout $testdir/INPUT
101
diff --git a/t/04stdin.t b/t/pipe.at
index 9b05e16..3b31f3f 100755..100644
--- a/t/04stdin.t
+++ b/t/pipe.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,12 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE supply stdin 17AT_SETUP([pipe stdin])
19 18AT_KEYWORDS([pipe])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -n all -i -f $INPUT -- genout -l 337 -o - -s 628 -l 734 -e $INPUT
21res=0 20],
21[0],
22[res=0
22exit code: 0 23exit code: 0
23stdout: 8 lines, 337 bytes 24stdout: 8 lines, 337 bytes
24stderr: 11 lines, 734 bytes 25stderr: 11 lines, 734 bytes
@@ -45,6 +46,5 @@ stderr listing:
45 10: after it, and fortunately was just in time to see it pop down a large 46 10: after it, and fortunately was just in time to see it pop down a large
46 11: rabbit-hole under the hedge. 47 11: rabbit-hole under the hedge.
47stderr listing ends 48stderr listing ends
48EOT 49])
49 50AT_CLEANUP
50rt -n all -f $testdir/INPUT -- genout -l 337 -o - -s 628 -l 734 -e $testdir/INPUT
diff --git a/t/rt.c b/t/rt.c
index 12a3232..e5c1bbb 100644
--- a/t/rt.c
+++ b/t/rt.c
@@ -91,9 +91,12 @@ static void
91linemon(const char *ptr, size_t len, void *data) 91linemon(const char *ptr, size_t len, void *data)
92{ 92{
93 struct linemon_closure *clos = data; 93 struct linemon_closure *clos = data;
94 94
95 if (!clos->cont) 95 if (!clos->cont) {
96 fprintf(stdout, "[%s]: ", clos->prefix); 96 printf("%s:", clos->prefix);
97 if (!(len == 1 && ptr[0] == '\n'))
98 putchar(' ');
99 }
97 fwrite(ptr, len, 1, stdout); 100 fwrite(ptr, len, 1, stdout);
98 clos->cont = ptr[len-1] != '\n'; 101 clos->cont = ptr[len-1] != '\n';
99} 102}
@@ -116,7 +119,10 @@ nl(struct runcap *rc, int stream)
116 n = 1; 119 n = 1;
117 while ((res = runcap_getline(rc, stream, &buf, &size)) > 0) { 120 while ((res = runcap_getline(rc, stream, &buf, &size)) > 0) {
118 buf[res-1] = 0; 121 buf[res-1] = 0;
119 printf("%*zu: %s\n", width, n, buf); 122 printf("%*zu:", width, n);
123 if (buf[0])
124 printf(" %s", buf);
125 putchar('\n');
120 n++; 126 n++;
121 } 127 }
122 if (res) 128 if (res)
diff --git a/t/08seek.t b/t/seek00.at
index c2312bd..4e1f4b0 100755..100644
--- a/t/08seek.t
+++ b/t/seek00.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,16 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE seek 17AT_SETUP([seek])
19 18AT_KEYWORDS([seek])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -r stdout:100:15:0\
21res=0 20 -r stdout:10:-20:1\
21 -r stdout:10:0:1\
22 -r stdout:10:-20:2\
23 -- genout $INPUT
24],
25[0],
26[res=0
22exit code: 0 27exit code: 0
23stdout: 71 lines, 4051 bytes 28stdout: 71 lines, 4051 bytes
24stderr: 0 lines, 0 bytes 29stderr: 0 lines, 0 bytes
@@ -34,10 +39,5 @@ READ 2:
34nk, and of 39nk, and of
35READ 3: 40READ 3:
36tten up so 41tten up so
37EOT 42])
38 43AT_CLEANUP
39rt -r stdout:100:15:0\
40 -r stdout:10:-20:1\
41 -r stdout:10:0:1\
42 -r stdout:10:-20:2\
43 -- genout $testdir/INPUT
diff --git a/t/09seek.t b/t/seek01.at
index 87628f1..62c1650 100755..100644
--- a/t/09seek.t
+++ b/t/seek01.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,17 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE seek, short buffer 17AT_SETUP([seek, short buffer])
19 18AT_KEYWORDS([seek shortbuf])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -s 16\
21res=0 20 -r stdout:100:15:0\
21 -r stdout:10:-20:1\
22 -r stdout:10:0:1\
23 -r stdout:10:-20:2\
24 -- genout $INPUT
25],
26[0],
27[res=0
22exit code: 0 28exit code: 0
23stdout: 71 lines, 4051 bytes 29stdout: 71 lines, 4051 bytes
24stderr: 0 lines, 0 bytes 30stderr: 0 lines, 0 bytes
@@ -34,11 +40,5 @@ READ 2:
34nk, and of 40nk, and of
35READ 3: 41READ 3:
36tten up so 42tten up so
37EOT 43])
38 44AT_CLEANUP
39rt -s 16\
40 -r stdout:100:15:0\
41 -r stdout:10:-20:1\
42 -r stdout:10:0:1\
43 -r stdout:10:-20:2\
44 -- genout $testdir/INPUT
diff --git a/t/00simple.t b/t/simple.at
index 31a4da2..d1f6a58 100755..100644
--- a/t/00simple.t
+++ b/t/simple.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testsuite for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,16 +14,14 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE simple capture 17AT_SETUP([simple capture])
19 18AT_KEYWORDS([simple])
20TC_EXPECT out <<EOT 19AT_CHECK([rt genout $INPUT
21res=0 20],
21[0],
22[res=0
22exit code: 0 23exit code: 0
23stdout: 71 lines, 4051 bytes 24stdout: 71 lines, 4051 bytes
24stderr: 0 lines, 0 bytes 25stderr: 0 lines, 0 bytes
25EOT 26])
26 27AT_CLEANUP
27rt genout $testdir/INPUT
28
29
30
diff --git a/t/05stdin.t b/t/stdin.at
index 6f9de3d..36f684c 100755..100644
--- a/t/05stdin.t
+++ b/t/stdin.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,12 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE pipe stdin 17AT_SETUP([supply stdin])
19 18AT_KEYWORDS([stdin])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -n all -f $INPUT -- genout -l 337 -o - -s 628 -l 734 -e $INPUT
21res=0 20],
21[0],
22[res=0
22exit code: 0 23exit code: 0
23stdout: 8 lines, 337 bytes 24stdout: 8 lines, 337 bytes
24stderr: 11 lines, 734 bytes 25stderr: 11 lines, 734 bytes
@@ -45,6 +46,5 @@ stderr listing:
45 10: after it, and fortunately was just in time to see it pop down a large 46 10: after it, and fortunately was just in time to see it pop down a large
46 11: rabbit-hole under the hedge. 47 11: rabbit-hole under the hedge.
47stderr listing ends 48stderr listing ends
48EOT 49])
49 50AT_CLEANUP
50rt -n all -i -f $testdir/INPUT -- genout -l 337 -o - -s 628 -l 734 -e $testdir/INPUT
diff --git a/t/testsuite b/t/testsuite
deleted file mode 100755
index bd870ce..0000000
--- a/t/testsuite
+++ b/dev/null
@@ -1,139 +0,0 @@
1#! /bin/sh
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff
4#
5# Runcap is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 3 of the License, or (at your
8# option) any later version.
9#
10# Runcap is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17
18testdir=$(cd $(dirname $0); pwd)
19progname=$(basename $0)
20
21topworkdir=$(pwd)
22workdir=$topworkdir/testsuite.dir
23if [ ! -d $workdir ]; then
24 mkdir $workdir
25fi
26
27cd $testdir
28numfiles=$(ls -1 *.t 2>/dev/null| sed -n '$=')
29
30if [ ${numfiles:-0} -eq 0 ]; then
31 echo >&2 "$progname: no test files in $testdir"
32 exit 2
33fi
34
35printheader() {
36 awk -v P=$numfiles 'NR==1 { num=$1; next }
37 NR==2 { printf("%0d: %s", num, $1); next }
38 { if (NF!=0) printf(" - %s", $0);
39 printf(": "); }' <<EOF
40$1
41$2
42$3
43EOF
44}
45
46PATH=$topworkdir:$PATH
47echo $PATH
48TC_EXPECT() {
49 cat > exp$1
50}
51TC_TITLE() {
52 :
53}
54
55numtests=0
56numfail=0
57cd $testdir
58exec 3>$topworkdir/testsuite.log
59
60if [ $# -gt 0 ]; then
61 testlist=$(ls $*) || exit 1
62else
63 testlist=$(ls *.t)
64fi
65
66for tc in $testlist
67do
68 cd $testdir
69 tc=$(echo $tc|sed 's|\./||')
70 # Skip if invalid name
71 echo "$tc" | grep -q '[^a-zA-Z0-9._-]' && continue
72 # Skip if not executable
73 test -x $tc || continue
74
75 cd $workdir
76
77 dirname=${tc%%.t}
78 if [ -d $dirname ]; then
79 rm -rf $dirname/*
80 else
81 mkdir $dirname || continue
82 fi
83 cd $dirname
84
85 descr=$(sed -n '/TC_TITLE /s///p' $testdir/$tc)
86 printheader $numtests $tc "$descr"
87 ( . $testdir/$tc ) >out 2>err
88 retcode=$?
89 numtests=$(( $numtests + 1 ))
90 cd $workdir
91
92 exec 4>templog
93 if [ $retcode -eq 77 ]; then
94 echo "SKIP"
95 continue
96 fi
97 if [ $retcode -ne 0 ]; then
98 echo >&4 "# exit code: $retcode"
99 fi
100
101 test -r $dirname/expout || > $dirname/expout
102 if ! cmp $dirname/expout $dirname/out 2>/dev/null >&2; then
103 echo >&4 "# stdout diff"
104 diff -pu $dirname/expout $dirname/out >&4
105 fi
106 test -r $dirname/experr || > $dirname/experr
107 if ! cmp $dirname/experr $dirname/err 2>/dev/null >&2; then
108 echo >&4 "# stderr diff"
109 diff -pu $dirname/experr $dirname/err >&4
110 fi
111
112 if [ -s templog ]; then
113 echo "FAIL"
114 numfail=$(( $numfail + 1 ))
115 echo >&3 "# Testcase $tc FAILED"
116 cat >&3 templog
117 echo >&3 "# Content:"
118 cat >&3 $testdir/$tc
119 echo >&3 "# stdout:"
120 cat >&3 $dirname/out
121 echo >&3 "# stderr:"
122 cat >&3 $dirname/err
123 else
124 echo "OK"
125 rm -rf $dirname
126 fi
127 rm templog
128done
129
130cd $topworkdir
131
132if [ $numfail -ne 0 ]; then
133 echo >&2 "# $numfail out of $numtests tests failed"
134 echo >&2 "# See testsuite.log for more info"
135 exit 1
136else
137 rmdir $workdir 2>/dev/null
138 rm testsuite.log
139fi
diff --git a/t/00simple.t b/t/testsuite.at
index 31a4da2..cdcec12 100755..100644
--- a/t/00simple.t
+++ b/t/testsuite.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testcase for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,16 +14,17 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE simple capture 17m4_version_prereq([2.69])
19
20TC_EXPECT out <<EOT
21res=0
22exit code: 0
23stdout: 71 lines, 4051 bytes
24stderr: 0 lines, 0 bytes
25EOT
26
27rt genout $testdir/INPUT
28
29 18
19AT_INIT
20m4_include([simple.at])
21m4_include([lines.at])
22m4_include([two.at])
23m4_include([longout.at])
24m4_include([stdin.at])
25m4_include([pipe.at])
26m4_include([linemon00.at])
27m4_include([linemon01.at])
28m4_include([seek00.at])
29m4_include([seek01.at])
30 30
diff --git a/t/02two.t b/t/two.at
index 142bbce..3be76b2 100755..100644
--- a/t/02two.t
+++ b/t/two.at
@@ -1,5 +1,4 @@
1#! ./testsuite 1# Testsuite for runcap - run program and capture its output -*- autotest -*-
2# testsuite for runcap - run program and capture its output
3# Copyright (C) 2017 Sergey Poznyakoff 2# Copyright (C) 2017 Sergey Poznyakoff
4# 3#
5# Runcap is free software; you can redistribute it and/or modify it 4# Runcap is free software; you can redistribute it and/or modify it
@@ -15,10 +14,12 @@
15# You should have received a copy of the GNU General Public License along 14# You should have received a copy of the GNU General Public License along
16# with Runcap. If not, see <http://www.gnu.org/licenses/>. 15# with Runcap. If not, see <http://www.gnu.org/licenses/>.
17 16
18TC_TITLE capture both stdout and stderr 17AT_SETUP([capture both stdout and stderr])
19 18AT_KEYWORDS([two])
20TC_EXPECT out <<EOT 19AT_CHECK([rt -n all -- genout -l 337 -o $INPUT -s 628 -l 734 -e $INPUT
21res=0 20],
21[0],
22[res=0
22exit code: 0 23exit code: 0
23stdout: 8 lines, 337 bytes 24stdout: 8 lines, 337 bytes
24stderr: 11 lines, 734 bytes 25stderr: 11 lines, 734 bytes
@@ -45,7 +46,5 @@ stderr listing:
45 10: after it, and fortunately was just in time to see it pop down a large 46 10: after it, and fortunately was just in time to see it pop down a large
46 11: rabbit-hole under the hedge. 47 11: rabbit-hole under the hedge.
47stderr listing ends 48stderr listing ends
48EOT 49])
49 50AT_CLEANUP
50rt -n all -- genout -l 337 -o $testdir/INPUT -s 628 -l 734 -e $testdir/INPUT
51

Return to:

Send suggestions and report system problems to the System administrator.