aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2017-08-19 20:24:59 +0300
committerSergey Poznyakoff <gray@gnu.org>2017-08-19 20:28:40 +0300
commitde5b0a9c0265b329b0c67cb02381fe7aebfd5186 (patch)
treef8462d313b327c6d3ace6445777e09de862eb8af
parent511f9c9765eb2a9992ea4470703ebcd96faca52b (diff)
downloadruncap-de5b0a9c0265b329b0c67cb02381fe7aebfd5186.tar.gz
runcap-de5b0a9c0265b329b0c67cb02381fe7aebfd5186.tar.bz2
Rewrite testsuite in autotest. Fix distcheck
-rw-r--r--.gitignore5
-rw-r--r--Make.am2
-rw-r--r--runcap.m47
-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 (renamed 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--t/testsuite.at30
-rw-r--r--[-rwxr-xr-x]t/two.at (renamed from t/02two.t)19
21 files changed, 402 insertions, 452 deletions
diff --git a/.gitignore b/.gitignore
index fcda02c..23e0192 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,8 +22,11 @@ configure
22depcomp 22depcomp
23*.lo 23*.lo
24install-sh 24install-sh
25*.in
26*.la 25*.la
27libtool 26libtool
28ltmain.sh 27ltmain.sh
29missing 28missing
29install.in
30shared.in
31static.in
32Makefile.in
diff --git a/Make.am b/Make.am
index fe56d41..7d5f0e6 100644
--- a/Make.am
+++ b/Make.am
@@ -35,7 +35,7 @@ RUNCAP_SRC = \
35 runcap.c\ 35 runcap.c\
36 seek.c\ 36 seek.c\
37 tell.c 37 tell.c
38EXTRA_DIST = Make.am installed.am shared.am static.am 38EXTRA_DIST = Make.am install.am shared.am static.am
39check: 39check:
40 $(MAKE) -C t check 40 $(MAKE) -C t check
41SUBDIRS = . t 41SUBDIRS = . t
diff --git a/runcap.m4 b/runcap.m4
index cd4c234..3d49f05 100644
--- a/runcap.m4
+++ b/runcap.m4
@@ -16,6 +16,7 @@
16AC_DEFUN([RUNCAP_SETUP],[ 16AC_DEFUN([RUNCAP_SETUP],[
17 m4_pushdef([runcapdir],m4_if($1,[.],,$1,,[runcap/],$1/)) 17 m4_pushdef([runcapdir],m4_if($1,[.],,$1,,[runcap/],$1/))
18 AC_SUBST([RUNCAP_INC],['-I$(top_srcdir)/]runcapdir') 18 AC_SUBST([RUNCAP_INC],['-I$(top_srcdir)/]runcapdir')
19 AC_SUBST([RUNCAP_LDADD],['-L$(top_builddir)/]runcapdir -lruncap')
19 AC_SUBST([RUNCAP_BUILD_TYPE]) 20 AC_SUBST([RUNCAP_BUILD_TYPE])
20 m4_if($2,[install],[ 21 m4_if($2,[install],[
21 LT_INIT 22 LT_INIT
@@ -33,7 +34,11 @@ AC_DEFUN([RUNCAP_SETUP],[
33 RUNCAP_LDADD=['$(top_builddir)/]runcapdir[libruncap.a'] 34 RUNCAP_LDADD=['$(top_builddir)/]runcapdir[libruncap.a']
34 AC_CONFIG_FILES(runcapdir[Makefile]:runcapdir[static.in]) 35 AC_CONFIG_FILES(runcapdir[Makefile]:runcapdir[static.in])
35 ]) 36 ])
36 AC_CONFIG_FILES(runcapdir[t/Makefile]) 37
38 AC_CONFIG_TESTDIR(runcapdir[t])
39 AC_CONFIG_FILES(runcapdir[t/Makefile] runcapdir[t/atlocal])
40 AM_MISSING_PROG([AUTOM4TE], [autom4te])
41
37 m4_popdef([runcapdir]) 42 m4_popdef([runcapdir])
38]) 43])
39 44
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
+++ /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
+++ /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 dai