Update Travis.
This commit is contained in:
@@ -6,9 +6,9 @@ set -e; set -o pipefail
|
|||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
argv0="$0"; argv0dir=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0dir")
|
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
else
|
else
|
||||||
argv0="$0"; argv0dir=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0dir")
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
fi
|
fi
|
||||||
source "$argv0dir/travis_init.sh" || exit 1
|
source "$argv0dir/travis_init.sh" || exit 1
|
||||||
|
|
||||||
|
|||||||
+15
-14
@@ -16,7 +16,7 @@ unset CROSS C B T
|
|||||||
[[ -z $BM_B ]] && BM_B=release
|
[[ -z $BM_B ]] && BM_B=release
|
||||||
|
|
||||||
# just in case, unset variable for passing extra UPX options
|
# just in case, unset variable for passing extra UPX options
|
||||||
UPX=
|
export UPX=
|
||||||
|
|
||||||
# compatibility wrappers
|
# compatibility wrappers
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
@@ -35,7 +35,7 @@ sort() {
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set CC and CXX from BM_C
|
# set CC and CXX from BM_C and BM_CROSS
|
||||||
if [[ -z $CC_OVERRIDE ]]; then
|
if [[ -z $CC_OVERRIDE ]]; then
|
||||||
CC=false CXX=false SCAN_BUILD=false
|
CC=false CXX=false SCAN_BUILD=false
|
||||||
AR=ar SIZE=size
|
AR=ar SIZE=size
|
||||||
@@ -102,6 +102,7 @@ esac
|
|||||||
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
||||||
CC="$CC -std=gnu89"
|
CC="$CC -std=gnu89"
|
||||||
fi
|
fi
|
||||||
|
unset v x
|
||||||
export AR CC CXX
|
export AR CC CXX
|
||||||
fi # CC_OVERRIDE
|
fi # CC_OVERRIDE
|
||||||
|
|
||||||
@@ -119,25 +120,25 @@ mkbuilddirs() {
|
|||||||
[[ -f "$d/.mfxnobackup" ]] || touch "$d/.mfxnobackup"
|
[[ -f "$d/.mfxnobackup" ]] || touch "$d/.mfxnobackup"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
# search for an existing toptop builddir
|
# search for an existing $toptop_builddir
|
||||||
for d in . ..; do
|
if [[ -z $toptop_builddir ]]; then
|
||||||
for subdir in "local" appveyor circle gitlab travis .; do
|
for d in . ..; do
|
||||||
dd=$d/build/$subdir
|
for subdir in "local" appveyor circle gitlab travis .; do
|
||||||
if [[ -z $toptop_builddir && -d $dd ]]; then
|
dd=$d/build/$subdir
|
||||||
toptop_builddir=$(readlink -en -- "$dd")
|
if [[ -d $dd ]]; then
|
||||||
break 2
|
toptop_builddir=$(readlink -en -- "$dd")
|
||||||
fi
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
done
|
unset d subdir dd
|
||||||
unset d subdir dd
|
fi
|
||||||
[[ -z $toptop_builddir ]] && toptop_builddir=$(readlink -mn -- ./build)
|
[[ -z $toptop_builddir ]] && toptop_builddir=$(readlink -mn -- ./build)
|
||||||
[[ -z $toptop_bdir ]] && toptop_bdir=$(readlink -mn -- "$toptop_builddir/$BM_C/$BM_B")
|
[[ -z $toptop_bdir ]] && toptop_bdir=$(readlink -mn -- "$toptop_builddir/$BM_C/$BM_B")
|
||||||
|
|
||||||
[[ -z $upx_BUILDDIR ]] && upx_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx")
|
[[ -z $upx_BUILDDIR ]] && upx_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx")
|
||||||
[[ -z $ucl_BUILDDIR ]] && ucl_BUILDDIR=$(readlink -mn -- "$toptop_bdir/ucl-1.03")
|
[[ -z $ucl_BUILDDIR ]] && ucl_BUILDDIR=$(readlink -mn -- "$toptop_bdir/ucl-1.03")
|
||||||
[[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx-testsuite")
|
[[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx-testsuite")
|
||||||
[[ -z $zlib_BUILDDIR ]] && zlib_BUILDDIR=$(readlink -mn -- "$toptop_bdir/zlib-1.2.8")
|
[[ -z $zlib_BUILDDIR ]] && zlib_BUILDDIR=$(readlink -mn -- "$toptop_bdir/zlib-1.2.8")
|
||||||
|
|
||||||
[[ -z $lcov_OUTPUTDIR ]] && lcov_OUTPUTDIR=$(readlink -mn -- "$toptop_bdir/.lcov-results")
|
[[ -z $lcov_OUTPUTDIR ]] && lcov_OUTPUTDIR=$(readlink -mn -- "$toptop_bdir/.lcov-results")
|
||||||
unset toptop_builddir toptop_bdir
|
unset toptop_builddir toptop_bdir
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ set -e; set -o pipefail
|
|||||||
#
|
#
|
||||||
|
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
argv0="$0"; argv0dir=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0dir")
|
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
else
|
else
|
||||||
argv0="$0"; argv0dir=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0dir")
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
fi
|
fi
|
||||||
source "$argv0dir/travis_init.sh" || exit 1
|
source "$argv0dir/travis_init.sh" || exit 1
|
||||||
|
|
||||||
@@ -53,10 +53,11 @@ testsuite_check_sha() {
|
|||||||
echo
|
echo
|
||||||
cat $1/.sha256sums.current
|
cat $1/.sha256sums.current
|
||||||
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
||||||
echo "UPX-ERROR: checksum mismatch"
|
echo "UPX-ERROR: $1 FAILED: checksum mismatch"
|
||||||
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
||||||
exit_code=1
|
exit_code=1
|
||||||
let num_errors+=1 || true
|
let num_errors+=1 || true
|
||||||
|
all_errors="${all_errors} $1"
|
||||||
#exit 1
|
#exit 1
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
@@ -66,18 +67,25 @@ testsuite_check_sha_decompressed() {
|
|||||||
(cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
(cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
||||||
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
||||||
cat $1/.sha256sums.current
|
cat $1/.sha256sums.current
|
||||||
echo "UPX-ERROR: decompressed checksum mismatch"
|
echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch"
|
||||||
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testsuite_use_canonicalized=0
|
||||||
testsuite_run_compress() {
|
testsuite_run_compress() {
|
||||||
testsuite_header $testdir
|
testsuite_header $testdir
|
||||||
local f
|
local files f
|
||||||
for f in t01_canonicalized/*/*; do
|
if [[ $testsuite_use_canonicalized == 1 ]]; then
|
||||||
|
files=t01_canonicalized/*/*
|
||||||
|
else
|
||||||
|
files=t01_decompressed/*/*
|
||||||
|
fi
|
||||||
|
for f in $files; do
|
||||||
testsuite_split_f $f
|
testsuite_split_f $f
|
||||||
[[ -z $fb ]] && continue
|
[[ -z $fb ]] && continue
|
||||||
|
echo "# $f"
|
||||||
mkdir -p $testdir/$fsubdir $testdir/.decompressed/$fsubdir
|
mkdir -p $testdir/$fsubdir $testdir/.decompressed/$fsubdir
|
||||||
$upx_run --prefer-ucl "$@" $f -o $testdir/$fsubdir/$fb
|
$upx_run --prefer-ucl "$@" $f -o $testdir/$fsubdir/$fb
|
||||||
$upx_run -qq -d $testdir/$fsubdir/$fb -o $testdir/.decompressed/$fsubdir/$fb
|
$upx_run -qq -d $testdir/$fsubdir/$fb -o $testdir/.decompressed/$fsubdir/$fb
|
||||||
@@ -86,10 +94,12 @@ testsuite_run_compress() {
|
|||||||
$upx_run -l $testdir/*/*
|
$upx_run -l $testdir/*/*
|
||||||
$upx_run --file-info $testdir/*/*
|
$upx_run --file-info $testdir/*/*
|
||||||
$upx_run -t $testdir/*/*
|
$upx_run -t $testdir/*/*
|
||||||
# check that after decompression the file matches the canonicalized version
|
if [[ $testsuite_use_canonicalized == 1 ]]; then
|
||||||
cp t01_canonicalized/.sha256sums.expected $testdir/.decompressed/
|
# check that after decompression the file matches the canonicalized version
|
||||||
testsuite_check_sha_decompressed $testdir/.decompressed
|
cp t01_canonicalized/.sha256sums.expected $testdir/.decompressed/
|
||||||
rm -rf ./$testdir/.decompressed
|
testsuite_check_sha_decompressed $testdir/.decompressed
|
||||||
|
rm -rf ./$testdir/.decompressed
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
@@ -99,6 +109,7 @@ testsuite_run_compress() {
|
|||||||
#set -x # debug
|
#set -x # debug
|
||||||
exit_code=0
|
exit_code=0
|
||||||
num_errors=0
|
num_errors=0
|
||||||
|
all_errors=
|
||||||
|
|
||||||
if [[ $BM_T =~ (^|\+)ALLOW_FAIL($|\+) ]]; then
|
if [[ $BM_T =~ (^|\+)ALLOW_FAIL($|\+) ]]; then
|
||||||
echo "ALLOW_FAIL"
|
echo "ALLOW_FAIL"
|
||||||
@@ -134,7 +145,10 @@ fi
|
|||||||
export UPX="--prefer-ucl --no-color --no-progress"
|
export UPX="--prefer-ucl --no-color --no-progress"
|
||||||
|
|
||||||
# let's go
|
# let's go
|
||||||
if ! $upx_run --version >/dev/null; then exit 1; fi
|
if ! $upx_run --version; then
|
||||||
|
echo "UPX-ERROR: FATAL: upx --version FAILED"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
rm -rf ./testsuite_1
|
rm -rf ./testsuite_1
|
||||||
mkbuilddirs testsuite_1
|
mkbuilddirs testsuite_1
|
||||||
cd testsuite_1 || exit 1
|
cd testsuite_1 || exit 1
|
||||||
@@ -298,6 +312,8 @@ time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
|
|||||||
|
|
||||||
|
|
||||||
testsuite_header "UPX testsuite summary"
|
testsuite_header "UPX testsuite summary"
|
||||||
|
$upx_run --version || echo "UPX-ERROR: upx --version FAILED"
|
||||||
|
echo
|
||||||
echo "upx_exe='$upx_exe'"
|
echo "upx_exe='$upx_exe'"
|
||||||
if [[ $upx_run != $upx_exe ]]; then
|
if [[ $upx_run != $upx_exe ]]; then
|
||||||
echo "upx_run='$upx_run'"
|
echo "upx_run='$upx_run'"
|
||||||
@@ -315,6 +331,7 @@ echo
|
|||||||
if [[ $exit_code == 0 ]]; then
|
if [[ $exit_code == 0 ]]; then
|
||||||
echo "UPX testsuite passed. All done."
|
echo "UPX testsuite passed. All done."
|
||||||
else
|
else
|
||||||
|
echo "UPX-ERROR: UPX testsuite FAILED:${all_errors}"
|
||||||
echo "UPX-ERROR: UPX testsuite FAILED with $num_errors error(s). See log file."
|
echo "UPX-ERROR: UPX testsuite FAILED with $num_errors error(s). See log file."
|
||||||
fi
|
fi
|
||||||
exit $exit_code
|
exit $exit_code
|
||||||
|
|||||||
Reference in New Issue
Block a user