1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
## Autotest testsuite for msitools.
# Copyright (C) 2012 Red Hat, Inc.
#
# This program 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 2, or (at your option)
# any later version.
#
# This program 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/>.
m4_include([package.m4])
AT_INIT
# Cannot use AT_TESTED because of $EXEEXT (Autotest bug)
AT_BANNER([gcab])
# AT_CHECK_... - add exeext automatically
m4_define([AT_CHECK_GCAB], [
AT_CHECK([_gcab ]$@)])
AT_SETUP([Invalid command line])
AT_CHECK_GCAB([], [1], [ignore], [ignore])
AT_CHECK_GCAB([-c out.cab], [1], [ignore], [ignore])
AT_CHECK([test -f out.cab], [1])
AT_CLEANUP
AT_SETUP([Add one file])
AT_DATA([test.txt], [This is test.txt
])
AT_CHECK_GCAB([-c out.cab test.txt])
AT_CHECK_GCAB([-t out.cab], [0],
[test.txt
])
cp test.txt expout
AT_CHECK_GCAB([-x out.cab], [0])
AT_CHECK([cat test.txt], [0], [expout])
#compressed
AT_CHECK_GCAB([-cz out.cab test.txt])
AT_CHECK_GCAB([-t out.cab], [0],
[test.txt
])
cp test.txt expout
AT_CHECK([gcab -x out.cab], [0])
AT_CHECK([cat test.txt], [0], [expout])
AT_CLEANUP
AT_SETUP([Check sorted files])
m4_define([FILES], [a o b c d q r s e f j l m n p t u v w x y z g h i k])
touch FILES
AT_CHECK_GCAB([-cz out.cab FILES], [0], [ignore], [ignore])
AT_CHECK_GCAB([-t out.cab | tr "\\n" " "], [0], [FILES ], [ignore])
AT_CLEANUP
|