test for file existence and delete files between tests

This commit is contained in:
discomfitor 2011-08-13 02:20:20 -04:00 committed by Con Kolivas
parent 6dd20d735b
commit b6dc92a7af

View file

@ -33,34 +33,37 @@ trap 'echo "ABORTING";end;exit' 1 2 15
echo testing compression from stdin echo testing compression from stdin
./lrzip -vvlfo lrztest.lrz < $infile ./lrzip -vvlfo lrztest.lrz < $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing compression from stdin echo FAILED testing compression from stdin
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing compression to stdout echo testing compression to stdout
./lrzip -vvlo - $infile > lrztest.lrz ./lrzip -vvlo - $infile > lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing compression to stdout echo FAILED testing compression to stdout
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing compression from stdin to stdout echo testing compression from stdin to stdout
./lrzip -vvl < $infile > lrztest.lrz ./lrzip -vvl < $infile > lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing compression from stdin to stdout echo FAILED testing compression from stdin to stdout
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing standard compression echo testing standard compression
./lrzip -vvlfo lrztest.lrz $infile ./lrzip -vvlfo lrztest.lrz $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing standard compression echo FAILED testing standard compression
end end
exit 1 exit 1
@ -69,52 +72,57 @@ fi
echo testing standard decompression echo testing standard decompression
./lrzip -vvdo lrztest lrztest.lrz ./lrzip -vvdo lrztest lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest ];then
echo FAILED testing standard decompression echo FAILED testing standard decompression
end end
exit 1 exit 1
fi fi
rm lrztest
echo testing standard decompression with file checking echo testing standard decompression with file checking
./lrzip -vvdfco lrztest lrztest.lrz ./lrzip -vvdfco lrztest lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest ];then
echo FAILED testing standard decompression with file checking echo FAILED testing standard decompression with file checking
end end
exit 1 exit 1
fi fi
rm lrztest
echo testing decompression from stdin echo testing decompression from stdin
./lrzip -vvfo lrztest -d < lrztest.lrz ./lrzip -vvfo lrztest -d < lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest ];then
echo FAILED testing decompression from stdin echo FAILED testing decompression from stdin
end end
exit 1 exit 1
fi fi
rm lrztest
echo testing decompression to stdout echo testing decompression to stdout
./lrzip -vvdo - lrztest.lrz > lrztest ./lrzip -vvdo - lrztest.lrz > lrztest
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest ];then
echo FAILED testing decompression to stdout echo FAILED testing decompression to stdout
end end
exit 1 exit 1
fi fi
rm lrztest
echo testing decompression from stdin to stdout echo testing decompression from stdin to stdout
./lrzip -vvd < lrztest.lrz > lrztest ./lrzip -vvd < lrztest.lrz > lrztest
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest ];then
echo FAILED testing decompression from stdin to stdout echo FAILED testing decompression from stdin to stdout
end end
exit 1 exit 1
fi fi
rm lrztest
echo testing testing echo testing testing
./lrzip -vvt lrztest.lrz ./lrzip -vvt lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing testing echo FAILED testing testing
end end
exit 1 exit 1
@ -123,16 +131,17 @@ fi
echo testing testing from stdin echo testing testing from stdin
./lrzip -vvt < lrztest.lrz ./lrzip -vvt < lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing testing from stdin echo FAILED testing testing from stdin
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing rzip only compression echo testing rzip only compression
./lrzip -vvnfo lrztest.lrz $infile ./lrzip -vvnfo lrztest.lrz $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing rzip only compression echo FAILED testing rzip only compression
end end
exit 1 exit 1
@ -141,16 +150,17 @@ fi
echo testing rzip only testing echo testing rzip only testing
./lrzip -vvt lrztest.lrz ./lrzip -vvt lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing rzip only testing echo FAILED testing rzip only testing
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing lzma compression echo testing lzma compression
./lrzip -vvfo lrztest.lrz $infile ./lrzip -vvfo lrztest.lrz $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing lzma compression echo FAILED testing lzma compression
end end
exit 1 exit 1
@ -159,16 +169,17 @@ fi
echo testing lzma testing echo testing lzma testing
./lrzip -vvt lrztest.lrz ./lrzip -vvt lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing lzma testing echo FAILED testing lzma testing
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing gzip compression echo testing gzip compression
./lrzip -vvgfo lrztest.lrz $infile ./lrzip -vvgfo lrztest.lrz $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing gzip compression echo FAILED testing gzip compression
end end
exit 1 exit 1
@ -177,16 +188,17 @@ fi
echo testing gzip testing echo testing gzip testing
./lrzip -vvt lrztest.lrz ./lrzip -vvt lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing gzip testing echo FAILED testing gzip testing
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing bzip2 compression echo testing bzip2 compression
./lrzip -vvbfo lrztest.lrz $infile ./lrzip -vvbfo lrztest.lrz $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing bzip2 compression echo FAILED testing bzip2 compression
end end
exit 1 exit 1
@ -195,16 +207,17 @@ fi
echo testing bzip2 testing echo testing bzip2 testing
./lrzip -vvt lrztest.lrz ./lrzip -vvt lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing bzip2 testing echo FAILED testing bzip2 testing
end end
exit 1 exit 1
fi fi
rm lrztest.lrz
echo testing zpaq compression echo testing zpaq compression
./lrzip -vvzfo lrztest.lrz $infile ./lrzip -vvzfo lrztest.lrz $infile
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing zpaq compression echo FAILED testing zpaq compression
end end
exit 1 exit 1
@ -213,7 +226,7 @@ fi
echo testing zpaq testing echo testing zpaq testing
./lrzip -vvt lrztest.lrz ./lrzip -vvt lrztest.lrz
if [ $? -ne 0 ];then if [ $? -ne 0 ] || [ ! -f lrztest.lrz ];then
echo FAILED testing zpaq testing echo FAILED testing zpaq testing
end end
exit 1 exit 1