Update Travis.

This commit is contained in:
Markus F.X.J. Oberhumer
2017-01-28 22:39:59 +01:00
parent f502f41359
commit 81268e7064
5 changed files with 148 additions and 57 deletions
+31 -15
View File
@@ -22,26 +22,35 @@ if [[ $BM_B =~ (^|\+)sanitize($|\+) ]]; then exit 0; fi
if [[ $BM_B =~ (^|\+)scan-build($|\+) ]]; then exit 0; fi
if [[ $BM_B =~ (^|\+)valgrind($|\+) ]]; then exit 0; fi
# prepare $subdir and $branch
subdir=
branch=
if [[ -n $APPVEYOR_JOB_ID ]]; then
TRAVIS_BRANCH=$APPVEYOR_REPO_BRANCH
branch=$APPVEYOR_REPO_BRANCH
if [[ -n $APPVEYOR_PULL_REQUEST_NUMBER ]]; then exit 0; fi
elif [[ -n $GITLAB_CI ]]; then
TRAVIS_BRANCH=$CI_BUILD_REF_NAME
subdir=$CI_BUILD_NAME
branch=$CI_BUILD_REF_NAME
else
branch=$TRAVIS_BRANCH
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi
fi
if [[ "$TRAVIS_BRANCH" != "devel" ]]; then
exit 0
fi
subdir=${subdir%%:*}; subdir=${subdir%%/*}; subdir=${subdir%%-*}
case $branch in
devel*) ;;
master*) ;;
travis*) ;;
*) exit 0;;
esac
# get $rev, $branch and $git_user
cd / && cd $upx_SRCDIR || exit 1
rev=$(git rev-parse --verify HEAD)
timestamp=$(git log -n1 --format='%at' HEAD)
date=$(TZ=UTC0 date -d "@$timestamp" '+%Y%m%d-%H%M%S')
#branch="$TRAVIS_BRANCH-$date-${rev:0:6}"
# make the branch name a little bit shorter so that is shows up nicely on GitHub
branch="$TRAVIS_BRANCH-${date:0:8}-${rev:0:7}"
#branch="$branch-$date-${rev:0:6}"
# make the branch name a little bit shorter so that it looks nice on GitHub
branch="$branch-${date:0:8}-${rev:0:7}"
if [[ -n $APPVEYOR_JOB_ID ]]; then
branch="$branch-appveyor"
git_user="AppVeyor CI"
@@ -69,8 +78,9 @@ if [[ -n $BM_CROSS ]]; then
else
cpu=unknown
case $BM_C in
clang*-m32 | gcc*-m32) cpu=i386;;
clang*-m64 | gcc*-m64) cpu=amd64;;
clang*-m32 | gcc*-m32) cpu=i386;;
clang*-m64 | gcc*-m64) cpu=amd64;;
clang*-mx32 | gcc*-mx32) cpu=amd64;;
msvc*-x86) cpu=i386;;
msvc*-x64) cpu=amd64;;
esac
@@ -112,11 +122,17 @@ if [[ $new_branch == 1 ]]; then
git reset --hard
fi
mv ../$d .
git add $d
if [[ -n $subdir ]]; then
[[ -d $subdir ]] || mkdir $subdir
mv ../$d $subdir/
git add $subdir/$d
else
mv ../$d .
git add $d
fi
if git diff --cached --exit-code --quiet >/dev/null; then
# nothing to do
# nothing to do ???
exit 0
fi
@@ -149,8 +165,8 @@ while true; do
else
if git push $ssh_repo $branch; then break; fi
fi
git fetch origin $branch
git rebase origin/$branch $branch
git fetch -v origin $branch
git rebase origin/$branch
sleep $((RANDOM % 5 + 1))
let i+=1
done
+9 -8
View File
@@ -132,22 +132,23 @@ if [[ -z $BM_CROSS ]]; then
case $BM_C in
clang | clang-m?? | clang-3.4-m?? | clang-[678][0-9][0-9]-m??)
CC="clang"; CXX="clang++" ;; # standard system compiler
clang-[34].[0-9]-m??)
clang-[3].[0-9]-m??)
v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
gcc | gcc-m??)
gcc | gcc-m?? | gcc-mx32)
CC="gcc"; CXX="g++" ;; # standard system compiler
gcc-[34].[0-9]-m??)
gcc-[34].[0-9]-m?? | gcc-[34].[0-9]-mx32)
v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
gcc-[56]-m?? | gcc-[56].[0-9]-m??)
gcc-[56]-m?? | gcc-[56]-mx32)
v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
esac
fi
fi # generic
case $BM_C in
clang*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
clang*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
clang*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
gcc*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
gcc*-mx32) CC="$CC -mx32"; CXX="$CXX -mx32" ;;
esac
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
CC="$CC -std=gnu89"
+8 -11
View File
@@ -31,7 +31,6 @@ mkbuilddirs $upx_testsuite_BUILDDIR
cd / && cd $upx_testsuite_BUILDDIR || exit 1
if [[ ! -d $upx_testsuite_SRCDIR/files/packed ]]; then exit 1; fi
# /***********************************************************************
# // support functions
# ************************************************************************/
@@ -105,7 +104,6 @@ testsuite_run_compress() {
fi
}
# /***********************************************************************
# // expected checksums
# //
@@ -230,7 +228,6 @@ b371684bbb2693797dd1164159de3bff9618bf6b99536542f57da07093dbb649 *m68k-atari.tos
"
########## end .sha256sums.recreate
# /***********************************************************************
# // init
# ************************************************************************/
@@ -260,8 +257,8 @@ if [[ $BM_T =~ (^|\+)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=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"
@@ -281,7 +278,6 @@ rm -rf ./testsuite_1
mkbuilddirs testsuite_1
cd testsuite_1 || exit 1
# /***********************************************************************
# // decompression tests
# ************************************************************************/
@@ -315,7 +311,6 @@ for f in t010_decompressed/*/*; do
done
testsuite_check_sha $testdir
# /***********************************************************************
# // compression tests
# // info: we use fast compression levels because we want to
@@ -350,7 +345,6 @@ 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
# ************************************************************************/
@@ -359,13 +353,16 @@ time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
recreate_expected_sha256sums .sha256sums.recreate
testsuite_header "UPX testsuite summary"
$upx_run --version || echo "UPX-ERROR: upx --version FAILED"
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
if [[ "$upx_run" != "$upx_exe" ]]; then
echo "upx_run='$upx_run'"
fi
if [[ -f $upx_exe ]]; then
if [[ -f "$upx_exe" ]]; then
ls -l "$upx_exe"
file "$upx_exe" || true
fi