exclude05.at 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Copyright (C) 2009, 2010 Free Software Foundation, Inc.
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 3, or (at your option)
  6. # any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. # Test the functioning of many items in an exclude list (should run quickly)
  14. AT_SETUP([exclude: lots of excludes])
  15. AT_KEYWORDS([exclude exclude05])
  16. AT_TAR_CHECK([
  17. AT_SORT_PREREQ
  18. rm -rf testdir exclfile
  19. mkdir -p testdir
  20. awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \
  21. while read name
  22. do
  23. genfile --file $name
  24. done
  25. awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile
  26. tar cf archive --anchored --exclude-from=exclfile \
  27. testdir
  28. tar tf archive | sort
  29. echo "NEXT"
  30. tar cf archive --exclude-from=exclfile \
  31. testdir
  32. tar tf archive | sort
  33. rm -rf testdir exclfile
  34. ],
  35. [0],
  36. [testdir/
  37. testdir/file10
  38. testdir/file11
  39. testdir/file9
  40. NEXT
  41. testdir/
  42. testdir/file10
  43. testdir/file11
  44. testdir/file9
  45. ])
  46. AT_CLEANUP