mirror of
https://github.com/upx/upx.git
synced 2025-02-25 10:31:15 +00:00
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="\
|
|
6942ac04e600534dbe0ff6dc2ac6500c90b43e81f3bce9519d3fb5c673aa8b12 *amd64-linux.elf/upx-3.91
|
|
c1a6ef9d0b8a26f1d6e3307af6f119bc95411a54421c7da3bd6ade9c4eead187 *arm-wince.pe/upx-3.91.exe
|
|
fe0a8ab1511f7688a6a17e26c2e0e6bae6501858054a1b7ff9c0a4b227b241fb *armeb-linux.elf/upx-3.91
|
|
7d5f0fd6f18e4cd16655ef58805f228bcaddd5b035ce998faed446e290aea3d9 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
4d4bbe63b792d9288b6c62ea8aa2f82f701f51f1fbf18aba2eec9a7794f56042 *i386-linux.elf/upx-3.91
|
|
d3cfb5347758ee54e54cfc92ae502a3e19702cd4fec115d74f84f8a5ab7a9bc2 *i386-win32.pe/upx-3.91.exe
|
|
c4c8b912a48bcaaef72fd94cd0c307659a03be2ec359bf01a42a2a39307dd964 *m68k-atari.tos/upx-3.91.ttp
|
|
9f00f9aad981d45fe9c81b6d532e885b6c54dc4eca2e27906290620d56e14efb *mipsel-linux.elf/upx-3.91
|
|
a36d48e011679701719bcedb38a2b7eff952462c4267ba74e1c94b3dc598cd8d *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
|
|
29b7231b54c615135c38da8177af2fc46fedc7c45a0db52b2a9d5adb0357158b *amd64-linux.elf/upx-3.91
|
|
2bb2477bdf4643954b4bb707b1017459238b03f66883303cd20e9e8740764dd7 *arm-wince.pe/upx-3.91.exe
|
|
d4aaa93b000f543cae1e55a7215733ac165044a77d1f23b3e2ab721c6fb88c73 *armeb-linux.elf/upx-3.91
|
|
c52473f5dbdac560c05d5d173e5342b5e696e604517359baef581672eb25a9e6 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
057d14808ad91b1fa04360baaad2351ce23db60852b8d10acf8637bd8a6e9985 *i386-linux.elf/upx-3.91
|
|
5bebadb8455b052580b1f22a949c3eb5a441c8b6ba9c6b50506cb703fc3f65ce *i386-win32.pe/upx-3.91.exe
|
|
ef94d8b0e02a650c302bec9f2d50462f2accc2fbb8003cc4977bc550d2e5b9f2 *m68k-atari.tos/upx-3.91.ttp
|
|
205a777371a893ec1dc78e39725148a1101f66dab4721e2f85c4538d3ac67aa8 *mipsel-linux.elf/upx-3.91
|
|
55af078ff5705f5045bb00bf95e8de7852c055b5c79cb0ac54278cbe2c23daab *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
|
|
f568767384b8400c48bb100c773f18ca9e7ad94903d1b5d365d6a546f4a7a0d1 *amd64-linux.elf/upx-3.91
|
|
0915344e0ee8e7c006e6cce71c024f518e097a88820c7ab3ca183ab1c614ce82 *arm-wince.pe/upx-3.91.exe
|
|
fe74cdd66123f91fa08b6deb404acd9a210acdf83b77787c6273b663aa692984 *armeb-linux.elf/upx-3.91
|
|
5c5ff78652e76834f3f9ab110c42e3a34ef54c748bce212b0e942049f43f5d4d *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
9c22f80bd0f1584f8f51f7fe6914cc689185ab6dd2de45da103dde781624dbc2 *i386-linux.elf/upx-3.91
|
|
ef5e25c79d356e9ed0736f34dc5ee7a8f4c66d0c330b8d16672fac7d829b5a7c *i386-win32.pe/upx-3.91.exe
|
|
dfc6abff2d3417b9708b1232d5791a9232c6623dcedb9dcb59428b67bbf864e9 *m68k-atari.tos/upx-3.91.ttp
|
|
206557a9daf49da7172faa114403cfb855d52bfdfca817c144607bccadbe38fc *mipsel-linux.elf/upx-3.91
|
|
0c53e1966bea6241e9bc73b2ec2447786761a7bc3c01e83f54f2cd865d46740e *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t140_compress_lzma_2_no_filter="\
|
|
d6a6423a4e1f9f2679cd707bfcb04973bc06ddfd2ca89a07c69525e5655bf934 *amd64-linux.elf/upx-3.91
|
|
3af2a2346a252dfacefb6209725907b2947dc1ccf5e99af139608354f852507c *arm-wince.pe/upx-3.91.exe
|
|
2bb08aee9fafcbf50f36a3bbd723770982a4240fcf9da28b6a6ae6717179880d *armeb-linux.elf/upx-3.91
|
|
964fb400b0b4a2b1926ce7076610db8c3a8e41807fe030209af1615d43b6a020 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
74cf79413af7e58f3db2e15157e4f3b9a49f94e6d14195ae207d1a27f2bcc909 *i386-linux.elf/upx-3.91
|
|
171bde9f27a5571b524e9d7cdba6cefa142bb8a0b114c4d5294944ee5781e0bb *i386-win32.pe/upx-3.91.exe
|
|
8826c1f910007360ba6cec02c91bd7cdc87bce1ce27804ca728846b92d9086c9 *m68k-atari.tos/upx-3.91.ttp
|
|
063ef9aba357517bd20bf22dec0f318f691c131ebc8c1dd8d4e56438d62d06ab *mipsel-linux.elf/upx-3.91
|
|
1954922943d62632054e1cd2f4aa06a7cc2b650d6ca7773e980517970a05bc8a *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t150_compress_ucl_2_all_filters="\
|
|
824e1ecdd822dbe41fc413a25eac0a4edd2b2f0b7b158f3cc8f51882f12b22c4 *amd64-linux.elf/upx-3.91
|
|
dc7323e753ce62e6a1c22112f139953dbaa1e5268530479f8ad48e0c54062295 *arm-wince.pe/upx-3.91.exe
|
|
df7c73c516b9a7ced0d0fdccbed203f69f8b5b30dc71ea75cec5519969d8af57 *armeb-linux.elf/upx-3.91
|
|
8614d93ba30def6866b3be92ae5bdd5f294266e0fc4a26c078682917f127656d *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
eaf4b3703bbbd6e50231228972b9cc092e50e42d5755bf98b223c277f5763672 *i386-linux.elf/upx-3.91
|
|
7c3d7398f63eb9e235992d2d8fd6de9e355f6f21621c45032a6ae6c9009067e6 *i386-win32.pe/upx-3.91.exe
|
|
25e9e84bf4e01350b362d088f8107d8228b4576bc47b6b718e9e742f7e4a5205 *m68k-atari.tos/upx-3.91.ttp
|
|
e9b8549f89762a015c388ae6dab51531c9bf18a49ba497b52eff6aa4238f14e9 *mipsel-linux.elf/upx-3.91
|
|
f8e40dbc146e78dc93d4adc0588be6f80731689e42edc041a87a460a116ad0ce *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
|
|
678df9732640d9980a0bffb766c9ac46d0d466a74983b49c43908273bf462592 *amd64-linux.elf/upx-3.91
|
|
1c9c618741739404f40d198d2fc77010539589379bf260502af9f10f1ec0d05b *arm-wince.pe/upx-3.91.exe
|
|
839c33b909f1ac37ae327d7fc506080e5e12cc90ee71c2a56557125d2e82bd54 *armeb-linux.elf/upx-3.91
|
|
863bbf7f3cf41296987b085a4db8acba372e3d65d8d9c656f9a7276f2e7aa4d3 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
9c582cb96e548f85037de03ec3ce4501dccd0a313dad3c57a07f2ee021d81593 *i386-linux.elf/upx-3.91
|
|
4c73a38e81fe12f36dc37e514f8580c12bdf5d8cb92e9a07b7070db291a2f7eb *i386-win32.pe/upx-3.91.exe
|
|
0f902defbce3c9a8ea08910ff2ac62b9f06e7ceed0570501cb3b6287bfd6d797 *m68k-atari.tos/upx-3.91.ttp
|
|
29346d789b8d24068303e67d14bec6f2014bfa661cb103c59afae252f235c4d0 *mipsel-linux.elf/upx-3.91
|
|
273fc6fc76a639b4314cb4fd3739e487220d8e193c79297fc795e5e275c723fe *powerpc-linux.elf/upx-3.91
|
|
"
|
|
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
|
|
bd0e43c0052927086cd0d1247fe438a3548fec983d4e5b0e1e9f3f44475ad3a6 *amd64-linux.elf/upx-3.91
|
|
66653a91c355a1ad1ab7b07c6c20b2d2899d0f42078683d0f4d540df476b1afb *arm-wince.pe/upx-3.91.exe
|
|
3506bc7fdb1cceaee443b944d0236253bae8c9f5e63397a29026ce8e4e258089 *armeb-linux.elf/upx-3.91
|
|
490a196fbba4a8f21bfb9ac2a3b92a6dc7e287f255a3ab987f7d29d5a75d8db4 *i386-dos32.djgpp2.coff/upx-3.91.exe
|
|
a58eb698cc6087270cf2bdc688c200b9e851601b870662d3b6321714652738ea *i386-linux.elf/upx-3.91
|
|
14b192b5419ca0ec2b3f238dc6ed9c17596e82ff2674a299d4b0a76d118a73de *i386-win32.pe/upx-3.91.exe
|
|
2eb756cf3c7e4f80fea379a267071c981f3ab1fbb3eaab7057ca18a2b400fb8f *m68k-atari.tos/upx-3.91.ttp
|
|
17012b4984faa8af976e918e79dfe5b3d7b098aae5ecbb2cf5ca215be7ca187b *mipsel-linux.elf/upx-3.91
|
|
c3381eca1f53bc3b499f56d5cbe8137b7f69a4dc819509fbb1152a1b15b1dd07 *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
|