mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
385 lines
17 KiB
Bash
385 lines
17 KiB
Bash
#! /bin/bash
|
|
## vim:set ts=4 sw=4 et:
|
|
set -e; set -o pipefail
|
|
|
|
# Support for Travis CI -- https://travis-ci.org/upx/upx/builds
|
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
|
|
|
#
|
|
# very first version of the upx-testsuite
|
|
#
|
|
|
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
|
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
|
else
|
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
|
fi
|
|
source "$argv0dir/travis_init.sh" || exit 1
|
|
|
|
if [[ $BM_T =~ (^|\+)SKIP($|\+) ]]; then
|
|
echo "UPX testsuite SKIPPED."
|
|
exit 0
|
|
fi
|
|
if [[ $BM_X == rebuild-stubs ]]; then
|
|
exit 0
|
|
fi
|
|
[[ -f $upx_exe ]] && upx_exe=$(readlink -en -- "$upx_exe")
|
|
|
|
# create dirs
|
|
cd / || exit 1
|
|
mkbuilddirs $upx_testsuite_BUILDDIR
|
|
cd / && cd $upx_testsuite_BUILDDIR || exit 1
|
|
if [[ ! -d $upx_testsuite_SRCDIR/files/packed ]]; then exit 1; fi
|
|
|
|
|
|
# /***********************************************************************
|
|
# // support functions
|
|
# ************************************************************************/
|
|
|
|
testsuite_header() {
|
|
local x="==========="; x="$x$x$x$x$x$x$x"
|
|
echo -e "\n${x}\n${1}\n${x}\n"
|
|
}
|
|
|
|
testsuite_split_f() {
|
|
fd=$(dirname "$1")
|
|
fb=$(basename "$1")
|
|
fsubdir=$(basename "$fd")
|
|
# sanity checks
|
|
if [[ ! -f $f || -z $fsubdir || -z $fb ]]; then
|
|
fd= fb= fsubdir=
|
|
fi
|
|
}
|
|
|
|
testsuite_check_sha() {
|
|
(cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
|
echo
|
|
cat $1/.sha256sums.current
|
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
|
echo "UPX-ERROR: $1 FAILED: checksum mismatch"
|
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
|
exit_code=1
|
|
let num_errors+=1 || true
|
|
all_errors="${all_errors} $1"
|
|
#exit 1
|
|
fi
|
|
echo
|
|
}
|
|
|
|
testsuite_check_sha_decompressed() {
|
|
(cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
|
cat $1/.sha256sums.current
|
|
echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch"
|
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
testsuite_use_canonicalized=1
|
|
testsuite_run_compress() {
|
|
testsuite_header $testdir
|
|
local files f
|
|
if [[ $testsuite_use_canonicalized == 1 ]]; then
|
|
files=t020_canonicalized/*/*
|
|
else
|
|
files=t010_decompressed/*/*
|
|
fi
|
|
for f in $files; do
|
|
testsuite_split_f $f
|
|
[[ -z $fb ]] && continue
|
|
echo "# $f"
|
|
mkdir -p $testdir/$fsubdir $testdir/.decompressed/$fsubdir
|
|
$upx_run -qq --prefer-ucl "$@" $f -o $testdir/$fsubdir/$fb
|
|
$upx_run -qq -d $testdir/$fsubdir/$fb -o $testdir/.decompressed/$fsubdir/$fb
|
|
done
|
|
testsuite_check_sha $testdir
|
|
$upx_run -qq -l $testdir/*/*
|
|
$upx_run -qq --file-info $testdir/*/*
|
|
$upx_run -q -t $testdir/*/*
|
|
if [[ $testsuite_use_canonicalized == 1 ]]; then
|
|
# check that after decompression the file matches the canonicalized version
|
|
cp t020_canonicalized/.sha256sums.expected $testdir/.decompressed/
|
|
testsuite_check_sha_decompressed $testdir/.decompressed
|
|
rm -rf "./$testdir/.decompressed"
|
|
fi
|
|
}
|
|
|
|
|
|
# /***********************************************************************
|
|
# // expected checksums
|
|
# //
|
|
# // To ease maintenance of this script in case of updates this section
|
|
# // can be automatically re-created from the current checksums -
|
|
# // see call of function recreate_expected_sha256sums below.
|
|
# ************************************************************************/
|
|
|
|
recreate_expected_sha256sums() {
|
|
local o="$1"
|
|
local files f d
|
|
echo "########## begin .sha256sums.recreate" > "$o"
|
|
files=*/.sha256sums.current
|
|
for f in $files; do
|
|
d=$(dirname "$f")
|
|
echo "expected_sha256sums__${d}="'"\' >> "$o"
|
|
cat "$f" >> "$o"
|
|
echo '"' >> "$o"
|
|
done
|
|
echo "########## end .sha256sums.recreate" >> "$o"
|
|
}
|
|
|
|
########## begin .sha256sums.recreate
|
|
expected_sha256sums__t010_decompressed="\
|
|
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
|
|
28d7ca8f0dfca8159e637eaf2057230b6e6719e07751aca1d19a45b5efed817c *arm-wince.pe/upx-3.91.exe
|
|
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
|
|
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
|
|
0dbc3c267ca8cd35ee3ea138b59c8b1ae35872c918be6d17df1a892b75710f9b *i386-win32.pe/upx-3.91.exe
|
|
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
|
|
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
|
|
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t020_canonicalized="\
|
|
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
|
|
28d7ca8f0dfca8159e637eaf2057230b6e6719e07751aca1d19a45b5efed817c *arm-wince.pe/upx-3.91.exe
|
|
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
|
|
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
|
|
0dbc3c267ca8cd35ee3ea138b59c8b1ae35872c918be6d17df1a892b75710f9b *i386-win32.pe/upx-3.91.exe
|
|
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
|
|
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
|
|
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
|
|
711613f904751818ae79a171eba66b95802660a77708958f5b2581a5dd8424b9 *amd64-linux.elf/upx-3.91
|
|
ca1502ae05d8686f49403a5bd643b7f30c388cc8711ea691bf016ab254181a0b *arm-wince.pe/upx-3.91.exe
|
|
460eeee0468ac0a27769d623f9a76a1085a1664717b6982d4880c7f1fe2b83aa *armeb-linux.elf/upx-3.91
|
|
495a6222d03d08767635c772f384086302d36e64028a85a5a23519dd91165ff6 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
d41c2002e923eed9442c0874c471cb0f86689c704387e3d0cc04bbee96c5925a *i386-linux.elf/upx-3.91
|
|
06794bdb9a8085ca5ef577648bf39402868a507f2a0bd02285c807929499aba4 *i386-win32.pe/upx-3.91.exe
|
|
74ea591c598557b0043554498c2b8fcc8ad89774877f50e32aa1c027d250bc77 *m68k-atari.tos/upx-3.91.ttp
|
|
ed7052ad1f5c32d463f7e110828958018b8b11a1887e0291db9e53040a420bed *mipsel-linux.elf/upx-3.91
|
|
415fbd90562d3baeaf00d976d5b9f078d09fc817e6bb17bb9b3512edf2b4bf8a *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
|
|
b0320c0eb6d1555e00a5928b6b5704e4630b07a00a6260628d9905f6269f53d6 *amd64-linux.elf/upx-3.91
|
|
7a485abafb347cb6e3804b9e74b8614c02c0eb7b6d25cf8c16e2235e9ae9f1b0 *arm-wince.pe/upx-3.91.exe
|
|
8e8e41bca9d3f443aaaaa55f637cbaa325aa5060f63f4f48accfd6719b181eda *armeb-linux.elf/upx-3.91
|
|
ef3ba5a8b4c4247baab3a3bfbb194bab2da9f11c76e37eff5b3ca0ffabb11f93 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
d209675d3f702b7d979c9b07b392f4f8902524c53df02ef2315f3c53a1ce9856 *i386-linux.elf/upx-3.91
|
|
4a65a19b430d50b9f15786342e3de86feb3627af07743b50a9ebfedb10c59a08 *i386-win32.pe/upx-3.91.exe
|
|
3a6c1362c7d32baedc211ee0c5cb72a6aa8faf0dc42dcdf382c699d0f119d17e *m68k-atari.tos/upx-3.91.ttp
|
|
d0dbaad494b7c84686bbcfaa4846baf891b4b706582561ca91d7647a89917279 *mipsel-linux.elf/upx-3.91
|
|
69641f9c2cc96e0e4969c49c533ffd798086d0dc4929a03c70721e165cda256e *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
|
|
d4fc328885deb6bd05ea5fcb4938ff5d6af1f5828d6a1be78d5a287c95c45ab8 *amd64-linux.elf/upx-3.91
|
|
dbde6514f1c4e18b4a1677d464f8b9fc9c38bf072c1c8f9a0be4add5353a0179 *arm-wince.pe/upx-3.91.exe
|
|
b6dd4c816c4a3cca6ceb4c4a7cf26a07edf3969c57baefca05165665c3421ed8 *armeb-linux.elf/upx-3.91
|
|
23ab101d4340b15a5992ac1686f8e940f5aff53664c9ae1f96336b1bac1c0115 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
dfc4f22ad934fb708f9fc20a9a593e29575350020729192f142362f14a7d5cb0 *i386-linux.elf/upx-3.91
|
|
ce874eafe18c0f09928992a3aa1f5fe9f0be9d89b87b39ecbcf1c460e4b8e0f7 *i386-win32.pe/upx-3.91.exe
|
|
0ea1e05587dd1af7b9df73d9e7a19d9d30831148737a93eee52724cf24487641 *m68k-atari.tos/upx-3.91.ttp
|
|
8f554f1e6071bcf5b62723ab6c540e04d81f8a1c4eb5ab34f9aa00b603e4b332 *mipsel-linux.elf/upx-3.91
|
|
8bf5a6437ab09399f9e5fcfa47eeff77b0f106691cfd3103327de6adb06ab898 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t140_compress_lzma_2_no_filter="\
|
|
eeb0c62b7e12b7a81fb277aa7e2bb5f62f82daae9327c8d5141aa2e630369383 *amd64-linux.elf/upx-3.91
|
|
42f856532fd39b59d5a8ba47816ca0e3343c5aacf4546e62053c6a872ff04820 *arm-wince.pe/upx-3.91.exe
|
|
fa63836f136da8374c78a0a574a98d40a726bd18d3f28cfca9df10bd113ccacc *armeb-linux.elf/upx-3.91
|
|
d3c965b98a0e1f820b8ed02c44c0d2613ec3645f29e8255744056263234f580c *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
170cc8ca4ae4a80d3c234fcaf35f52936973191d5aeafbcd30b1b90cdf12452d *i386-linux.elf/upx-3.91
|
|
f828953a66d7b3394dd2514b5972680a0cc651bd198b7607f6d3f6f6cc390a0e *i386-win32.pe/upx-3.91.exe
|
|
d5ff6615dc37369599a8f423610e14a747c03e11bbef1d9657990e6e4597051e *m68k-atari.tos/upx-3.91.ttp
|
|
0d0f015b5f62bf475ce7161a3ddc6bd7946667e47e4af7cd6344d4bf015c11eb *mipsel-linux.elf/upx-3.91
|
|
8e369f138beb785e2338b984d96a5f069c278dad1d86abba3286dce0f98890f7 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t150_compress_ucl_2_all_filters="\
|
|
de3f69e4b2ece10f0eb36505a7eff9a9ad1dc621174cfa626950893c2decf98b *amd64-linux.elf/upx-3.91
|
|
3dbba2a6c2dc0149cfc7881fcb12f416c51e1fbf34b629cf4c1957e0080940d4 *arm-wince.pe/upx-3.91.exe
|
|
791dd0d70548f3aaae9a4d109720c69e04d907c393851be6a118f1112be19d93 *armeb-linux.elf/upx-3.91
|
|
9d32d88bfbc0c0b24a312ad2647cebd420671306f9a14393164ca363d742088e *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
9367ebd1e5d9c54235bd77864dfb7e15d8ec0b3cf4d5f1f010759ad25b1e7f5c *i386-linux.elf/upx-3.91
|
|
b4f27ba234a5c9b4f68e2067602a180c02f95fb044830f54a45267fe1c50bb83 *i386-win32.pe/upx-3.91.exe
|
|
453ebbd98bb1732a9f681e2e3cd2f0452189fec18894cad6e85812ad8742591d *m68k-atari.tos/upx-3.91.ttp
|
|
700a9ea2691ab5b78514b697180f68d1fc1b0c9a84c2fde30923766f40ba7a6a *mipsel-linux.elf/upx-3.91
|
|
4158057beb6abee09af2d14110312f1eb3d49c024772d9fe2c776139027042b9 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
|
|
dcafe60b62ad7bfd5fcc47d86c93af2eb1c557a69e28c24a60732b4f8bf03283 *amd64-linux.elf/upx-3.91
|
|
5a731fdf5fca3b212b2e12a1472c439d7fda931ee4e1d968e82b9e4ca7703d72 *arm-wince.pe/upx-3.91.exe
|
|
b64aeee3a8e8dca4fa7c8a8f855566865088aac6d2f702c329f8a3229f4f8142 *armeb-linux.elf/upx-3.91
|
|
9735bec46a7d42c5976ddc46b0f817c5cd9ac8743aa4ee1abb14a04f47530670 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
6b0dc03f1cdf3200b8767d3579d1a92f8c4ec3bdb024e90d1aed4fbbc7d6bac3 *i386-linux.elf/upx-3.91
|
|
e669d7c4fec901130dd387dc8f95e3b3f5e739d6ef0bfac10080dbd257084ae6 *i386-win32.pe/upx-3.91.exe
|
|
fa8dc3fcdc4cedf111a95f9b063d4b3a9d308a9935c1cdcd9ef61a695df551eb *m68k-atari.tos/upx-3.91.ttp
|
|
c24baf3ff21c52bcc4418a0b4faec4e17d7c19c14423f9fde84d7ba3d1a4dc09 *mipsel-linux.elf/upx-3.91
|
|
4782307d0f4ca7a3d4352b9073015458397dfb28bdce6d9cb62a0a7c04543d80 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
|
|
ed8844cb8e78d5282d20487118a5af8b35dc9a71b5c54397fac8d84abb5783ca *amd64-linux.elf/upx-3.91
|
|
61471c0bee67c0fbabbeb8cde4b4925d6a1e23d9ede9658085adcc8f3fb34499 *arm-wince.pe/upx-3.91.exe
|
|
5dcfbfcfcef0f987cd119484d0307c88cec5a166550a32554b2c193befb2744b *armeb-linux.elf/upx-3.91
|
|
7577c05d767fc0495a5d051d8080c6b840b644c02b7ca24b23fc93818999f44b *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
a92a91ac7b695fed656edf2d3179d3337d35462004c292b1579e73c816b1c4a4 *i386-linux.elf/upx-3.91
|
|
51e91ff8226517ad8cd06d240e2c6c2f3d3e4033af1e593a5b294356d1bb5d33 *i386-win32.pe/upx-3.91.exe
|
|
a158da08738435ea4cc50526e9156817ab0c83016169c2700d7737d72f1d69c0 *m68k-atari.tos/upx-3.91.ttp
|
|
cc27505e0361fccdb95c4610e054db878a283d85f992ec1748a554de02e7f997 *mipsel-linux.elf/upx-3.91
|
|
a444c7103141e6050f67b4e7ba8cc20a38ad0003d93200e6db1f237029631fe2 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
########## end .sha256sums.recreate
|
|
|
|
|
|
# /***********************************************************************
|
|
# // init
|
|
# ************************************************************************/
|
|
|
|
#set -x # debug
|
|
exit_code=0
|
|
num_errors=0
|
|
all_errors=
|
|
|
|
if [[ $BM_T =~ (^|\+)ALLOW_FAIL($|\+) ]]; then
|
|
echo "ALLOW_FAIL"
|
|
set +e
|
|
fi
|
|
|
|
[[ -z $upx_exe && -f $upx_BUILDDIR/upx.out ]] && upx_exe=$upx_BUILDDIR/upx.out
|
|
[[ -z $upx_exe && -f $upx_BUILDDIR/upx.exe ]] && upx_exe=$upx_BUILDDIR/upx.exe
|
|
if [[ -z $upx_exe ]]; then exit 1; fi
|
|
upx_run=$upx_exe
|
|
if [[ $BM_T =~ (^|\+)qemu($|\+) && -n $upx_qemu ]]; then
|
|
upx_run="$upx_qemu $upx_qemu_flags -- $upx_exe"
|
|
fi
|
|
if [[ $BM_T =~ (^|\+)wine($|\+) && -n $upx_wine ]]; then
|
|
upx_run="$upx_wine $upx_wine_flags $upx_exe"
|
|
fi
|
|
if [[ $BM_T =~ (^|\+)valgrind($|\+) ]]; then
|
|
if [[ -z $upx_valgrind ]]; then
|
|
upx_valgrind="valgrind"
|
|
fi
|
|
if [[ -z $upx_valgrind_flags ]]; then
|
|
upx_valgrind_flags="--leak-check=full --show-reachable=yes"
|
|
upx_valgrind_flags="-q --leak-check=no --error-exitcode=1"
|
|
upx_valgrind_flags="--leak-check=no --error-exitcode=1"
|
|
fi
|
|
upx_run="$upx_valgrind $upx_valgrind_flags $upx_exe"
|
|
fi
|
|
|
|
if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then
|
|
(cd / && cd $upx_BUILDDIR && lcov -d . --zerocounters)
|
|
fi
|
|
|
|
export UPX="--prefer-ucl --no-color --no-progress"
|
|
|
|
# let's go
|
|
if ! $upx_run --version; then echo "UPX-ERROR: FATAL: upx --version FAILED"; exit 1; fi
|
|
if ! $upx_run -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi
|
|
if ! $upx_run --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi
|
|
rm -rf ./testsuite_1
|
|
mkbuilddirs testsuite_1
|
|
cd testsuite_1 || exit 1
|
|
|
|
|
|
# /***********************************************************************
|
|
# // decompression tests
|
|
# ************************************************************************/
|
|
|
|
testdir=t010_decompressed
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
|
|
testsuite_header $testdir
|
|
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do
|
|
testsuite_split_f $f
|
|
[[ -z $fb ]] && continue
|
|
echo "# $f"
|
|
mkdir -p $testdir/$fsubdir
|
|
$upx_run -qq -d $f -o $testdir/$fsubdir/$fb
|
|
done
|
|
testsuite_check_sha $testdir
|
|
|
|
|
|
# run one pack+unpack step to canonicalize the files
|
|
testdir=t020_canonicalized
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
|
|
testsuite_header $testdir
|
|
for f in t010_decompressed/*/*; do
|
|
testsuite_split_f $f
|
|
[[ -z $fb ]] && continue
|
|
echo "# $f"
|
|
mkdir -p $testdir/$fsubdir/.packed
|
|
$upx_run -qq --prefer-ucl -1 $f -o $testdir/$fsubdir/.packed/$fb
|
|
$upx_run -qq -d $testdir/$fsubdir/.packed/$fb -o $testdir/$fsubdir/$fb
|
|
done
|
|
testsuite_check_sha $testdir
|
|
|
|
|
|
# /***********************************************************************
|
|
# // compression tests
|
|
# // info: we use fast compression levels because we want to
|
|
# // test UPX and not the compression libraries
|
|
# ************************************************************************/
|
|
|
|
testdir=t110_compress_ucl_nrv2b_3_no_filter
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress --nrv2b -3 --no-filter
|
|
|
|
testdir=t120_compress_ucl_nrv2d_3_no_filter
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress --nrv2d -3 --no-filter
|
|
|
|
testdir=t130_compress_ucl_nrv2e_3_no_filter
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress --nrv2e -3 --no-filter
|
|
|
|
testdir=t140_compress_lzma_2_no_filter
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress --lzma -2 --no-filter
|
|
|
|
testdir=t150_compress_ucl_2_all_filters
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress -2 --all-filters
|
|
|
|
testdir=t160_compress_all_methods_1_no_filter
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress --all-methods -1 --no-filter
|
|
|
|
testdir=t170_compress_all_methods_no_lzma_5_no_filter
|
|
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
|
|
time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
|
|
|
|
|
|
# /***********************************************************************
|
|
# // summary
|
|
# ************************************************************************/
|
|
|
|
# recreate checkums from current version for an easy update in case of changes
|
|
recreate_expected_sha256sums .sha256sums.recreate
|
|
|
|
testsuite_header "UPX testsuite summary"
|
|
$upx_run --version || echo "UPX-ERROR: upx --version FAILED"
|
|
echo
|
|
echo "upx_exe='$upx_exe'"
|
|
if [[ $upx_run != $upx_exe ]]; then
|
|
echo "upx_run='$upx_run'"
|
|
fi
|
|
if [[ -f $upx_exe ]]; then
|
|
ls -l "$upx_exe"
|
|
file "$upx_exe" || true
|
|
fi
|
|
echo "upx_testsuite_SRCDIR='$upx_testsuite_SRCDIR'"
|
|
echo "upx_testsuite_BUILDDIR='$upx_testsuite_BUILDDIR'"
|
|
echo ".sha256sums.{expected,current}:"
|
|
cat */.sha256sums.expected | LC_ALL=C sort | wc
|
|
cat */.sha256sums.current | LC_ALL=C sort | wc
|
|
echo
|
|
if [[ $exit_code == 0 ]]; then
|
|
echo "UPX testsuite passed. All done."
|
|
else
|
|
echo "UPX-ERROR: UPX testsuite FAILED:${all_errors}"
|
|
echo "UPX-ERROR: UPX testsuite FAILED with $num_errors error(s). See log file."
|
|
fi
|
|
exit $exit_code
|