compress.at.in 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2018 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  5. # GNU tar is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU tar 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. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # tar can create/decompress @tool@-compressed tarballs
  16. AT_SETUP([compress: @tool@])
  17. AT_KEYWORDS([compression @tool@])
  18. unset TAR_OPTIONS
  19. AT_CHECK([
  20. AT_GZIP_PREREQ([@tool@])
  21. touch empty
  22. # Create with --@tool@:
  23. tar --@tool@ -cf - empty 2>err > k.tar.@suff@ || exit 1
  24. test -s err && exit 1
  25. tar tf k.tar.@suff@ 2>err > out || exit 1
  26. test "$(cat out)" = empty || exit 1
  27. test -s err && exit 1
  28. # Ensure -ac works with an -f-specified .@suff@-suffixed name.
  29. tar -acf k2.tar.@suff@ empty 2>err > out || exit 1
  30. cmp k2.tar.@suff@ k.tar.@suff@ || exit 1
  31. test -s err && exit 1
  32. # Extraction: ensure the .@suff@ suffix is recognized.
  33. rm -f empty || exit 1
  34. tar xf k.tar.@suff@ 2>err > out || exit 1
  35. test -s err && exit 1
  36. test -f empty || exit 1
  37. if test -n '@suff2@'; then
  38. # Extraction: ensure the .@suff2@ suffix is also recognized.
  39. mv k.tar.@suff@ k.@suff2@ || exit 1
  40. rm -f empty
  41. tar xf k.@suff2@ 2>err > out || exit 1
  42. test -s err && exit 1
  43. test -f empty || exit 1
  44. else
  45. :
  46. fi
  47. ],
  48. [0],
  49. [],
  50. [],
  51. [],[])
  52. AT_CLEANUP