Files
tar/tests/compress.at.in
Jim Meyering e8c3f4860d tests: add coverage for new --zstd and all other compression tools
* tests/compress.at.in: New file: template from which each
per-compression-tool test is derived.
* tests/Makefile.am (TESTSUITE_AT): Add it.
(EXTRA_DIST): Add compress.at.in.
(compress-*.at): New rules to generate a file/tests for each compression tool.
* tests/testsuite.at (Compression): Add each of these generated
files in a new section.
* tests/.gitignore: Ignore the new generated files.
2018-04-07 10:32:38 +03:00

68 lines
1.8 KiB
Plaintext

# Process this file with autom4te to create testsuite. -*- Autotest -*-
# Test suite for GNU tar.
# Copyright 2018 Free Software Foundation, Inc.
# This file is part of GNU tar.
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# tar can create/decompress @tool@-compressed tarballs
AT_SETUP([compress: @tool@])
AT_KEYWORDS([compression @tool@])
unset TAR_OPTIONS
AT_CHECK([
AT_GZIP_PREREQ([@tool@])
touch empty
# Create with --@tool@:
tar --@tool@ -cf - empty 2>err > k.tar.@suff@ || exit 1
test -s err && exit 1
tar tf k.tar.@suff@ 2>err > out || exit 1
test "$(cat out)" = empty || exit 1
test -s err && exit 1
# Ensure -ac works with an -f-specified .@suff@-suffixed name.
tar -acf k2.tar.@suff@ empty 2>err > out || exit 1
cmp k2.tar.@suff@ k.tar.@suff@ || exit 1
test -s err && exit 1
# Extraction: ensure the .@suff@ suffix is recognized.
rm -f empty || exit 1
tar xf k.tar.@suff@ 2>err > out || exit 1
test -s err && exit 1
test -f empty || exit 1
if test -n '@suff2@'; then
# Extraction: ensure the .@suff2@ suffix is also recognized.
mv k.tar.@suff@ k.@suff2@ || exit 1
rm -f empty
tar xf k.@suff2@ 2>err > out || exit 1
test -s err && exit 1
test -f empty || exit 1
else
:
fi
],
[0],
[],
[],
[],[])
AT_CLEANUP