mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00

modified: stub/src/i386-linux.elf-fold.S modified: ../.github/travis_testsuite_1.sh modified: stub/i386-linux.elf-fold.h modified: stub/tmp/i386-linux.elf-fold.map
381 lines
17 KiB
Bash
381 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() {
|
|
print_header "$1"
|
|
}
|
|
|
|
testsuite_split_f() {
|
|
fd=$(dirname "$1")
|
|
fb=$(basename "$1")
|
|
fsubdir=$(basename "$fd")
|
|
# sanity checks
|
|
if [[ ! -f "$1" || -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="\
|
|
5b7938b426ea815f13f4f5e5c416c67df32650ba08fdc2a83cc7676f88cec461 *amd64-linux.elf/upx-3.91
|
|
c1a6ef9d0b8a26f1d6e3307af6f119bc95411a54421c7da3bd6ade9c4eead187 *arm-wince.pe/upx-3.91.exe
|
|
819eb6b8847f3760edadb8b196b50f2558c2f9f842bc4ef4bb8114aed853a4d6 *armeb-linux.elf/upx-3.91
|
|
7d5f0fd6f18e4cd16655ef58805f228bcaddd5b035ce998faed446e290aea3d9 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
1675d73911682fcc20a92c4cc6bf80c967d97c3a57c854f74d376ef8d1450f15 *i386-linux.elf/upx-3.91
|
|
d3cfb5347758ee54e54cfc92ae502a3e19702cd4fec115d74f84f8a5ab7a9bc2 *i386-win32.pe/upx-3.91.exe
|
|
c4c8b912a48bcaaef72fd94cd0c307659a03be2ec359bf01a42a2a39307dd964 *m68k-atari.tos/upx-3.91.ttp
|
|
889e9e9e3b904e3115a7723e5a8e46504cbcbaf1dcadec58877a27c62963033e *mipsel-linux.elf/upx-3.91
|
|
680df2db2771adcbc8f7826928c6f6583b54297943fd6a314f2a8873ed9858ea *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
|
|
70c7e9da1ea26ff9369560b4b33f49296fff9b6d7bb5683d06d2ceb31f5d3405 *amd64-linux.elf/upx-3.91
|
|
2bb2477bdf4643954b4bb707b1017459238b03f66883303cd20e9e8740764dd7 *arm-wince.pe/upx-3.91.exe
|
|
c1e4edce4786a94aa12b1ee26aeccba477b5b3b5c7fe82466b1321e93690eb11 *armeb-linux.elf/upx-3.91
|
|
c52473f5dbdac560c05d5d173e5342b5e696e604517359baef581672eb25a9e6 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
ca41fe0a1f32b42fdc8264cb5cbaf57dc2d9d6b9343265f6f8210573243c2303 *i386-linux.elf/upx-3.91
|
|
5bebadb8455b052580b1f22a949c3eb5a441c8b6ba9c6b50506cb703fc3f65ce *i386-win32.pe/upx-3.91.exe
|
|
ef94d8b0e02a650c302bec9f2d50462f2accc2fbb8003cc4977bc550d2e5b9f2 *m68k-atari.tos/upx-3.91.ttp
|
|
31c028003f28bfe664b9ac31d74327b9f10e69a52f225fe80ed62bb3c1056993 *mipsel-linux.elf/upx-3.91
|
|
a2c7b256d4173122f2c5f1e90f4354e6259a18739e66b3a4b671bb921d8be915 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
|
|
0aa0397c6e6e728992c8cd09fb203bc90d7e114ed9f40c2880b72ed78fa63589 *amd64-linux.elf/upx-3.91
|
|
0915344e0ee8e7c006e6cce71c024f518e097a88820c7ab3ca183ab1c614ce82 *arm-wince.pe/upx-3.91.exe
|
|
673d386ad4f284035e9c575e7d5e1dc92d77761f3741c0df3d361e23ca1fd357 *armeb-linux.elf/upx-3.91
|
|
5c5ff78652e76834f3f9ab110c42e3a34ef54c748bce212b0e942049f43f5d4d *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
6deaa3f0a2a613030cc4185da140becdd4b71f3aabfff3fa6854b971af6cb92f *i386-linux.elf/upx-3.91
|
|
ef5e25c79d356e9ed0736f34dc5ee7a8f4c66d0c330b8d16672fac7d829b5a7c *i386-win32.pe/upx-3.91.exe
|
|
dfc6abff2d3417b9708b1232d5791a9232c6623dcedb9dcb59428b67bbf864e9 *m68k-atari.tos/upx-3.91.ttp
|
|
68768e06b4261d749b1e697d1a75e0871e66b21f59d4235e4998d88f98b540ad *mipsel-linux.elf/upx-3.91
|
|
342350804bd91a64825dc022142df9efac0f98a400dd24ad49d890865fcdd10e *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t140_compress_lzma_2_no_filter="\
|
|
926006d4461c7df64659aa7b484a663ff0d482712c2240c3b40f7a63d3f9c07c *amd64-linux.elf/upx-3.91
|
|
3af2a2346a252dfacefb6209725907b2947dc1ccf5e99af139608354f852507c *arm-wince.pe/upx-3.91.exe
|
|
11045dca0976b131ec5bfd58160627c72462e8b9d35fdfc64f3f0c6eb9d497ca *armeb-linux.elf/upx-3.91
|
|
964fb400b0b4a2b1926ce7076610db8c3a8e41807fe030209af1615d43b6a020 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
d7a31bf4bc27dae47707731dbf59d7f9bf61038f21c81d6c7ce081285a9bb79d *i386-linux.elf/upx-3.91
|
|
171bde9f27a5571b524e9d7cdba6cefa142bb8a0b114c4d5294944ee5781e0bb *i386-win32.pe/upx-3.91.exe
|
|
8826c1f910007360ba6cec02c91bd7cdc87bce1ce27804ca728846b92d9086c9 *m68k-atari.tos/upx-3.91.ttp
|
|
bd9b3d1d7f66bf3b2394d3c96b61613323df15ab48d877621576637feecb445f *mipsel-linux.elf/upx-3.91
|
|
b599ec1ac95748e5964fed0a262d6fdf45eb2677289d00675e3a20dbd182593a *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t150_compress_ucl_2_all_filters="\
|
|
b7ae93def74c119d62ef1a92eb06074b8ce3a4429512ac64de6120097fb48692 *amd64-linux.elf/upx-3.91
|
|
dc7323e753ce62e6a1c22112f139953dbaa1e5268530479f8ad48e0c54062295 *arm-wince.pe/upx-3.91.exe
|
|
25f2d135e042e417f66e193b801a654990027b2fd584f0ff976fe3e888f639df *armeb-linux.elf/upx-3.91
|
|
8614d93ba30def6866b3be92ae5bdd5f294266e0fc4a26c078682917f127656d *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
53797fc3ebaf0a805e2f1db8a39cb90feaa96ecb50255c333eca9aa159645534 *i386-linux.elf/upx-3.91
|
|
7c3d7398f63eb9e235992d2d8fd6de9e355f6f21621c45032a6ae6c9009067e6 *i386-win32.pe/upx-3.91.exe
|
|
25e9e84bf4e01350b362d088f8107d8228b4576bc47b6b718e9e742f7e4a5205 *m68k-atari.tos/upx-3.91.ttp
|
|
3a347f56fff4538bdfd30dab402c7656c4a15d42c390e828b106679f35589b4d *mipsel-linux.elf/upx-3.91
|
|
c7a9e77ca00eee8116513ad27b82de1d9d1c9100c7d533113ccbd3b99c91fc67 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
|
|
e091849d471a5eb866a34ebe09ca4ccae014dae5b592b59b013a4a689bd67385 *amd64-linux.elf/upx-3.91
|
|
1c9c618741739404f40d198d2fc77010539589379bf260502af9f10f1ec0d05b *arm-wince.pe/upx-3.91.exe
|
|
001e2bd3c30ea0f21ec800c48be8877aa1d1cd97819353bd9713ef15baed7783 *armeb-linux.elf/upx-3.91
|
|
863bbf7f3cf41296987b085a4db8acba372e3d65d8d9c656f9a7276f2e7aa4d3 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
ad88a49ff5251397f20858c3b60aee23e1ad3bca440ff187608781164b263b9a *i386-linux.elf/upx-3.91
|
|
4c73a38e81fe12f36dc37e514f8580c12bdf5d8cb92e9a07b7070db291a2f7eb *i386-win32.pe/upx-3.91.exe
|
|
0f902defbce3c9a8ea08910ff2ac62b9f06e7ceed0570501cb3b6287bfd6d797 *m68k-atari.tos/upx-3.91.ttp
|
|
cf18d628feb7720b962a64b5b240dc86268257973cce46e2d98c67de4e4cdf50 *mipsel-linux.elf/upx-3.91
|
|
2e46e51385a86ac403da8edefe595d0627259ab483f871a53d228ca21a03ede7 *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
|
|
46d8a75ddc5141f042431188404f720aa2966982d3df25d058b43f4dec692eb0 *amd64-linux.elf/upx-3.91
|
|
66653a91c355a1ad1ab7b07c6c20b2d2899d0f42078683d0f4d540df476b1afb *arm-wince.pe/upx-3.91.exe
|
|
9563feafae70b78f8bcdb7b831adea7eeb87dba232e660a307e83ceafd5dcfad *armeb-linux.elf/upx-3.91
|
|
490a196fbba4a8f21bfb9ac2a3b92a6dc7e287f255a3ab987f7d29d5a75d8db4 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
d30326c5acb6d5fd15d69a5d08d7b2eaee05dacfb999581dbc0312cded9a9d26 *i386-linux.elf/upx-3.91
|
|
14b192b5419ca0ec2b3f238dc6ed9c17596e82ff2674a299d4b0a76d118a73de *i386-win32.pe/upx-3.91.exe
|
|
2eb756cf3c7e4f80fea379a267071c981f3ab1fbb3eaab7057ca18a2b400fb8f *m68k-atari.tos/upx-3.91.ttp
|
|
80fa1894a5f3406c1d8e238623cfbaf1fc736e28fb822554d5a2d274ff31d8fd *mipsel-linux.elf/upx-3.91
|
|
bd4482fec346ec52435cb77ab50249fe63f11033dbc79bda24d4897b90d2b1fd *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"
|
|
if ! $upx_run --version; then
|
|
echo "UPX-ERROR: upx --version FAILED"
|
|
exit 1
|
|
fi
|
|
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
|