]> Dogcows Code - chaz/tar/blob - tests/testsuite.at
Fix hard links recognition with -c --remove-files
[chaz/tar] / tests / testsuite.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 # We need a recent Autotest.
22 m4_version_prereq([2.52g])
23
24 m4_define([AT_TAR_CHECK_HOOK])
25 m4_define([AT_TAR_CHECK],[
26 AT_XFAIL_IF(test -f $[]XFAILFILE)
27 m4_foreach([FMT],
28 [m4_if([$7],[],[v7,oldgnu,ustar,posix,gnu],[$7])],
29 [AT_CHECK([
30 mkdir FMT
31 (cd FMT
32 TEST_TAR_FORMAT=FMT
33 export TEST_TAR_FORMAT
34 TAR_OPTIONS="-H FMT"
35 export TAR_OPTIONS
36 rm -rf *
37 $1)],$2,$3,$4,$5,$6)
38 AT_TAR_CHECK_HOOK])
39 ])
40
41 m4_define([AT_TAR_WITH_HOOK],[
42 m4_pushdef([AT_TAR_CHECK_HOOK],[$1])
43 $2
44
45 m4_popdef([AT_TAR_CHECK_HOOK])])
46
47 m4_define([TAR_IGNREC_HOOK],[
48 AT_CHECK([grep -v '^.*tar: Record size = ' stderr; exit 0])
49 ])
50
51 m4_define([RE_CHECK],[
52 AT_DATA([$1.re],[$2])
53 awk '{print NR " " $[]0}' $1 > $[]$.1
54 awk '{print NR " " $[]0}' $1.re | join - $[]$.1 |
55 while read NUM RE LINE
56 do
57 echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
58 done
59 ])
60
61 m4_define([AT_SKIP_TEST],[exit 77])
62
63 dnl AT_TARBALL_PREREQ(tarball, md5sum) - Check if test tarball exists
64 dnl in $TEST_DATA_DIR. If it does not, try to download it from
65 dnl $TEST_DATA_URL. If download fails, or it the file's md5 sum does not
66 dnl match second argument, skip the test.
67
68 m4_define([AT_TARBALL_PREREQ],[
69 test -z "$[]TEST_DATA_DIR" && AT_SKIP_TEST
70 tarball_prereq $1 $2 $[]TEST_DATA_DIR $[]TEST_DATA_URL || AT_SKIP_TEST])
71
72 dnl AT_TARBALL_PREREQ(tarball, md5sum) - Same for star testfiles
73 m4_define([AT_STAR_PREREQ],[
74 test -z "$STAR_TESTSCRIPTS" && AT_SKIP_TEST
75 tarball_prereq $1 $2 $[]STAR_TESTSCRIPTS $[]STAR_DATA_URL || AT_SKIP_TEST
76 ])
77
78 dnl AT_GZIP_PREREQ - Skip test unless gzip (or $1) is available
79 m4_define([AT_GZIP_PREREQ],[
80 cat /dev/null | m4_if([$1],[],gzip,[$1]) - > /dev/null 2>&1 || AT_SKIP_TEST
81 ])
82
83 dnl AT_SORT_PREREQ - Skip test if sort utility outputs unwanted data on stderr
84 m4_define([AT_SORT_PREREQ],[
85 test -z "`sort < /dev/null 2>&1`" || AT_SKIP_TEST
86 ])
87
88 dnl AT_UNPRIVILEGED_PREREQ - Skip test if running at root privileges
89 m4_define([AT_UNPRIVILEGED_PREREQ],[
90 echo "test" > $[]$
91 chmod 0 $[]$
92 cat $[]$ > /dev/null 2>&1
93 result=$?
94 rm -f $[]$
95 test $result -eq 0 && AT_SKIP_TEST
96 ])
97
98 m4_define([AT_TAR_MKHIER],[
99 install-sh -d $1 >/dev/null dnl
100 m4_if([$2],,,&& genfile --file [$1]/[$2]) || AT_SKIP_TEST])
101
102 m4_include([sparsemvp.at])
103
104 AT_INIT
105
106 AT_TESTED([tar])
107
108 m4_include([version.at])
109
110 m4_include([pipe.at])
111
112 m4_include([options.at])
113 m4_include([options02.at])
114
115 m4_include([T-empty.at])
116 m4_include([T-null.at])
117
118 m4_include([indexfile.at])
119 m4_include([verbose.at])
120
121 m4_include([append.at])
122 m4_include([append01.at])
123 m4_include([append02.at])
124
125 m4_include([xform-h.at])
126
127 m4_include([exclude.at])
128
129 m4_include([delete01.at])
130 m4_include([delete02.at])
131 m4_include([delete03.at])
132 m4_include([delete04.at])
133 m4_include([delete05.at])
134
135 m4_include([extrac01.at])
136 m4_include([extrac02.at])
137 m4_include([extrac03.at])
138 m4_include([extrac04.at])
139 m4_include([extrac05.at])
140 m4_include([extrac06.at])
141 m4_include([extrac07.at])
142
143 m4_include([gzip.at])
144
145 m4_include([incremental.at])
146 m4_include([incr01.at])
147 m4_include([incr02.at])
148 m4_include([listed01.at])
149 m4_include([listed02.at])
150 m4_include([incr03.at])
151 m4_include([incr04.at])
152 m4_include([rename01.at])
153 m4_include([rename02.at])
154 m4_include([rename03.at])
155 m4_include([rename04.at])
156 m4_include([rename05.at])
157 m4_include([chtype.at])
158
159 m4_include([ignfail.at])
160
161 m4_include([link01.at])
162 m4_include([link02.at])
163 m4_include([link03.at])
164
165 m4_include([longv7.at])
166 m4_include([long01.at])
167 m4_include([lustar01.at])
168 m4_include([lustar02.at])
169 m4_include([lustar03.at])
170
171 m4_include([multiv01.at])
172 m4_include([multiv02.at])
173 m4_include([multiv03.at])
174 m4_include([multiv04.at])
175 m4_include([multiv05.at])
176 m4_include([multiv06.at])
177
178 m4_include([old.at])
179
180 m4_include([recurse.at])
181
182 m4_include([same-order01.at])
183 m4_include([same-order02.at])
184
185 m4_include([shortrec.at])
186
187 m4_include([sparse01.at])
188 m4_include([sparse02.at])
189 m4_include([sparse03.at])
190 m4_include([sparsemv.at])
191 m4_include([spmvp00.at])
192 m4_include([spmvp01.at])
193 m4_include([spmvp10.at])
194
195 m4_include([update.at])
196
197 m4_include([volume.at])
198 m4_include([volsize.at])
199
200 m4_include([comprec.at])
201 m4_include([shortfile.at])
202 m4_include([shortupd.at])
203
204 m4_include([truncate.at])
205 m4_include([grow.at])
206
207 m4_include([star/gtarfail.at])
208 m4_include([star/gtarfail2.at])
209
210 m4_include([star/multi-fail.at])
211
212 m4_include([star/ustar-big-2g.at])
213 m4_include([star/ustar-big-8g.at])
214
215 m4_include([star/pax-big-10g.at])
This page took 0.045534 seconds and 5 git commands to generate.