1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
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 2, or (at your option)
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.
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
21 # We need a recent Autotest.
22 m4_version_prereq([2.52g])
24 m4_define([AT_TAR_CHECK],[
26 [m4_if([$7],[],[v7,oldgnu,ustar,posix,gnu],[$7])],
31 export TEST_TAR_FORMAT
35 $1)],$2,$3,$4,$5,$6)])
38 m4_define([RE_CHECK],[
40 awk '{print NR " " $[]0}' $1 > $[]$.1
41 awk '{print NR " " $[]0}' $1.re | join - $[]$.1 |
42 while read NUM RE LINE
44 echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
48 m4_define([AT_SKIP_TEST],[exit 77])
50 dnl AT_TARBALL_PREREQ(tarball, md5sum) - Check if test tarball exists
51 dnl in $TEST_DATA_DIR. If it does not, try to download it from
52 dnl $TEST_DATA_URL. If download fails, or it the file's md5 sum does not
53 dnl match second argument, skip the test.
55 m4_define([AT_TARBALL_PREREQ],[
56 test -z "$[]TEST_DATA_DIR" && AT_SKIP_TEST
57 tarball_prereq $1 $2 $[]TEST_DATA_DIR $[]TEST_DATA_URL || AT_SKIP_TEST])
59 dnl AT_TARBALL_PREREQ(tarball, md5sum) - Same for star testfiles
60 m4_define([AT_STAR_PREREQ],[
61 test -z "$STAR_TESTSCRIPTS" && AT_SKIP_TEST
62 tarball_prereq $1 $2 $[]STAR_TESTSCRIPTS $[]STAR_DATA_URL || AT_SKIP_TEST
65 dnl AT_GZIP_PREREQ - Skip test unless gzip (or $1) is available
66 m4_define([AT_GZIP_PREREQ],[
67 cat /dev/null | m4_if([$1],[],gzip,[$1]) - > /dev/null 2>&1 || AT_SKIP_TEST
70 dnl AT_SORT_PREREQ - Skip test if sort utility outputs unwanted data on stderr
71 m4_define([AT_SORT_PREREQ],[
72 test -z "`sort < /dev/null 2>&1`" || AT_SKIP_TEST
75 dnl AT_UNPRIVILEGED_PREREQ - Skip test if running at root privileges
76 m4_define([AT_UNPRIVILEGED_PREREQ],[
79 cat $[]$ > /dev/null 2>&1
82 test $result -eq 0 && AT_SKIP_TEST
85 m4_define([AT_TAR_MKHIER],[
86 mkinstalldirs $1 >/dev/null
87 genfile --file $1/$2])
93 m4_include([version.at])
97 m4_include([options.at])
98 m4_include([options02.at])
100 m4_include([append.at])
101 m4_include([append01.at])
103 m4_include([delete01.at])
104 m4_include([delete02.at])
105 m4_include([delete03.at])
106 m4_include([delete04.at])
107 m4_include([delete05.at])
109 m4_include([extrac01.at])
110 m4_include([extrac02.at])
111 m4_include([extrac03.at])
112 m4_include([extrac04.at])
113 m4_include([extrac05.at])
114 m4_include([extrac06.at])
116 m4_include([gzip.at])
118 m4_include([incremental.at])
119 m4_include([incr01.at])
120 m4_include([incr02.at])
121 m4_include([listed01.at])
122 m4_include([listed02.at])
123 m4_include([incr03.at])
124 m4_include([rename01.at])
125 m4_include([rename02.at])
126 m4_include([rename03.at])
127 m4_include([chtype.at])
129 m4_include([ignfail.at])
131 m4_include([link01.at])
133 m4_include([longv7.at])
134 m4_include([long01.at])
135 m4_include([lustar01.at])
136 m4_include([lustar02.at])
137 m4_include([lustar03.at])
139 m4_include([multiv01.at])
140 m4_include([multiv02.at])
141 m4_include([multiv03.at])
142 m4_include([multiv04.at])
146 m4_include([recurse.at])
148 m4_include([same-order01.at])
149 m4_include([same-order02.at])
151 m4_include([shortrec.at])
153 m4_include([sparse01.at])
154 m4_include([sparse02.at])
155 m4_include([sparse03.at])
156 m4_include([sparsemv.at])
157 m4_include([sparsemvp.at])
159 m4_include([update.at])
161 m4_include([volume.at])
162 m4_include([volsize.at])
164 m4_include([comprec.at])
166 m4_include([truncate.at])
168 m4_include([star/gtarfail.at])
169 m4_include([star/gtarfail2.at])
171 m4_include([star/multi-fail.at])
173 m4_include([star/ustar-big-2g.at])
174 m4_include([star/ustar-big-8g.at])
176 m4_include([star/pax-big-10g.at])