Update Travis.

This commit is contained in:
Markus F.X.J. Oberhumer 2016-09-28 09:54:48 +02:00
parent cf998f945c
commit 4134a512b9
5 changed files with 69 additions and 55 deletions

View File

@ -5,15 +5,21 @@ os: Visual Studio 2015
environment: environment:
matrix: matrix:
- APPVEYOR_JOB_ARCH: x64 # - { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 }
- APPVEYOR_JOB_ARCH: x86 ### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # x64 is not installed
# - { C: msvc-11.0-x86, CL_VERSION: 17.00, VS_VERSION: 2012 }
### - { C: msvc-11.0-x64, CL_VERSION: 17.00, VS_VERSION: 2012 } # x64 is not installed
- { C: msvc-12.0-x86, CL_VERSION: 18.00, VS_VERSION: 2013 }
- { C: msvc-12.0-x64, CL_VERSION: 18.00, VS_VERSION: 2013 }
- { C: msvc-14.0-x86, CL_VERSION: 19.00, VS_VERSION: 2015 }
- { C: msvc-14.0-x64, CL_VERSION: 19.00, VS_VERSION: 2015 }
init: init:
- git config --global core.autocrlf input - git config --global core.autocrlf input
install: install:
- cd c:\projects - cd c:\projects
- mkdir deps - mkdir build build\%C% deps
- cd c:\projects\upx - cd c:\projects\upx
- git submodule update --init --recursive - git submodule update --init --recursive
- cd c:\projects\deps - cd c:\projects\deps
@ -23,22 +29,33 @@ install:
- sed -i '/snprintf *_v*snprintf/d' ucl-1.03/acc/acc_auto.h - sed -i '/snprintf *_v*snprintf/d' ucl-1.03/acc/acc_auto.h
- tar -xzf zlib-1.2.8.tar.gz - tar -xzf zlib-1.2.8.tar.gz
- git clone https://github.com/upx/upx-testsuite - git clone https://github.com/upx/upx-testsuite
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 ) - if "%C%"=="msvc-10.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 ) - if "%C%"=="msvc-10.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64 )
- if "%C%"=="msvc-11.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 )
- if "%C%"=="msvc-11.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64 )
- if "%C%"=="msvc-12.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 )
- if "%C%"=="msvc-12.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 )
- if "%C%"=="msvc-14.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 )
- if "%C%"=="msvc-14.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 )
build_script: build_script:
- set B=release
- set DEFS=-D_CRT_SECURE_NO_WARNINGS - set DEFS=-D_CRT_SECURE_NO_WARNINGS
- cd c:\projects\deps\ucl-1.03 - set BDIR=c:\projects\build\%C%\%B%
- cl -MT -O2 -W4 %DEFS% -Iinclude -I. -c src\*.c - mkdir %BDIR% %BDIR%\ucl-1.03 %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib-1.2.8
- cd %BDIR%\ucl-1.03
- set s=c:\projects\deps\ucl-1.03
- cl -MT -O2 -W4 %DEFS% -I%s%\include -I%s% -c %s%\src\*.c
- link -lib -out:ucl.lib *.obj - link -lib -out:ucl.lib *.obj
- cd c:\projects\deps\zlib-1.2.8 - cd %BDIR%\zlib-1.2.8
- cl -MT -O2 -W3 -wd4131 -wd4996 %DEFS% -I. -c *.c - cl -MT -O2 -W2 %DEFS% -c c:\projects\deps\zlib-1.2.8\*.c
- link -lib -out:zlib.lib *.obj - link -lib -out:zlib.lib *.obj
- cd c:\projects\upx\src - cd %BDIR%\upx
- cl -MT -EHsc -O2 -W4 -wd4244 %DEFS% -DWITH_LZMA=0x443 -DUCL_NO_ASM -Ilzma-sdk -Ic:\projects\deps\ucl-1.03\include -Ic:\projects\deps\zlib-1.2.8 -Feupx.exe *.cpp c:\projects\deps\ucl-1.03\ucl.lib c:\projects\deps\zlib-1.2.8\zlib.lib - set s=c:\projects\upx\src
- cl -MT -EHsc -O2 -W4 -wd4244 %DEFS% -DWITH_LZMA=0x443 -DUCL_NO_ASM -I%s%\lzma-sdk -Ic:\projects\deps\ucl-1.03\include -Ic:\projects\deps\zlib-1.2.8 -Feupx.exe %s%\*.cpp %BDIR%\ucl-1.03\ucl.lib %BDIR%\zlib-1.2.8\zlib.lib
test_script: test_script:
- cd c:\projects\upx\src - cd %BDIR%\upx
- .\upx.exe --version - .\upx.exe --version
- .\upx.exe upx.exe -o upx_packed.exe - .\upx.exe upx.exe -o upx_packed.exe
- dir *.exe - dir *.exe

View File

@ -7,7 +7,7 @@ set -e; set -o pipefail
source ./.github/travis_init.sh || exit 1 source ./.github/travis_init.sh || exit 1
echo "BUILD_METHOD='$BUILD_METHOD'" echo "B='$B'"
echo "UPX_UCLDIR='$UPX_UCLDIR'" echo "UPX_UCLDIR='$UPX_UCLDIR'"
echo "CC='$CC'" echo "CC='$CC'"
echo "CXX='$CXX'" echo "CXX='$CXX'"
@ -74,23 +74,23 @@ cd $upx_BUILDDIR || exit 1
make="make -f $upx_SRCDIR/src/Makefile" make="make -f $upx_SRCDIR/src/Makefile"
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DUCL_NO_ASM" EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DUCL_NO_ASM"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$ucl_BUILDDIR/src/.libs" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$ucl_BUILDDIR/src/.libs"
case $BUILD_METHOD in coverage | coverage+* | *+coverage | *+coverage+*) if [[ $B =~ (^|\+)coverage($|\+) ]]; then
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -fprofile-arcs -ftest-coverage" EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -fprofile-arcs -ftest-coverage"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage" ;; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage"
esac fi
case $BUILD_METHOD in debug | debug+* | *+debug | *+debug+*) if [[ $B =~ (^|\+)debug($|\+) ]]; then
make="$make USE_DEBUG=1" ;; make="$make USE_DEBUG=1"
esac fi
case $BUILD_METHOD in sanitize | sanitize+* | *+sanitize | *+sanitize+*) if [[ $B =~ (^|\+)sanitize($|\+) ]]; then
case $TRAVIS_OS_NAME-$CC in linux-gcc*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fuse-ld=gold" ;; esac case $TRAVIS_OS_NAME-$CC in linux-gcc*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fuse-ld=gold" ;; esac
make="$make USE_SANITIZE=1" ;; make="$make USE_SANITIZE=1"
esac fi
case $BUILD_METHOD in scan-build | scan-build+* | *+scan-build | *+scan-build+*) if [[ $B =~ (^|\+)scan-build($|\+) ]]; then
make="$SCAN_BUILD $make" ;; make="$SCAN_BUILD $make"
esac fi
case $BUILD_METHOD in valgrind | valgrind+* | *+valgrind | *+valgrind+*) if [[ $B =~ (^|\+)valgrind($|\+) ]]; then
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DWITH_VALGRIND" ;; EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DWITH_VALGRIND"
esac fi
if [[ $ALLOW_FAIL == 1 ]]; then if [[ $ALLOW_FAIL == 1 ]]; then
echo "ALLOW_FAIL=$ALLOW_FAIL" echo "ALLOW_FAIL=$ALLOW_FAIL"
set +e set +e

View File

@ -6,33 +6,35 @@
#set -x # debug #set -x # debug
umask 022 umask 022
# set CC and CXX from C
CC=false CXX=false SCAN_BUILD=false CC=false CXX=false SCAN_BUILD=false
[[ -z $C ]] && C=gcc [[ -z $C ]] && C=gcc
case $C in case $C in
clang | clang-m?? | clang-3.4-m?? | clang-[678][0-9][0-9]-m??) clang | clang-m?? | clang-3.4-m?? | clang-[678][0-9][0-9]-m??)
# standard system compiler CC="clang"; CXX="clang++" ;; # standard system compiler
CC="clang"; CXX="clang++" ;;
clang-[34].[0-9]-m??) clang-[34].[0-9]-m??)
v=${C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;; v=${C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
gcc | gcc-m?? | gcc-4.6-m??) gcc | gcc-m??)
# standard system compiler CC="gcc"; CXX="g++" ;; # standard system compiler
CC="gcc"; CXX="g++" ;;
gcc-[34].[0-9]-m??) gcc-[34].[0-9]-m??)
v=${C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;; v=${C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
gcc-[56]-m?? | gcc-[56].[0-9]-m??) gcc-[56]-m?? | gcc-[56].[0-9]-m??)
v=${C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;; v=${C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
msvc | msvc-*)
CC="cl"; CXX="cl" ;; # standard system compiler
esac esac
case $C in case $C in
*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;; msvc*) ;;
*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;; clang*-m32) CC="$CC -m32"; CXX="$CXX -m32" ;;
gcc*-m64) CC="$CC -m64"; CXX="$CXX -m64" ;;
esac esac
case $C in case $C in
clang* | gcc*) CC="$CC -std=gnu89" ;; clang* | gcc*) CC="$CC -std=gnu89" ;;
esac esac
export CC CXX export CC CXX
# B is BUILD_TYPE
[[ -z $B ]] && B=release [[ -z $B ]] && B=release
BUILD_METHOD="$B"
# dirs # dirs
[[ -z $upx_SRCDIR ]] && upx_SRCDIR="$PWD" [[ -z $upx_SRCDIR ]] && upx_SRCDIR="$PWD"

View File

@ -28,9 +28,9 @@ if [[ $TRAVIS_OS_NAME == osx ]]; then
sha256sum=gsha256sum # brew install coreutils sha256sum=gsha256sum # brew install coreutils
fi fi
upx=$PWD/upx.out upx=$PWD/upx.out
case $BUILD_METHOD in valgrind | valgrind+* | *+valgrind | *+valgrind+*) if [[ $B =~ (^|\+)valgrind($|\+) ]]; then
upx="valgrind --leak-check=full --show-reachable=yes $upx" ;; upx="valgrind --leak-check=full --show-reachable=yes $upx"
esac fi
upx_391= upx_391=
if [[ $TRAVIS_OS_NAME == linux ]]; then if [[ $TRAVIS_OS_NAME == linux ]]; then
rm -f upx391.out rm -f upx391.out
@ -38,9 +38,9 @@ if [[ $TRAVIS_OS_NAME == linux ]]; then
upx_391="$PWD/upx391.out --fake-stub-version=3.92 --fake-stub-year=2016" upx_391="$PWD/upx391.out --fake-stub-version=3.92 --fake-stub-year=2016"
fi fi
case $BUILD_METHOD in coverage | coverage+* | *+coverage | *+coverage+*) if [[ $B =~ (^|\+)coverage($|\+) ]]; then
lcov -d $upx_BUILDDIR --zerocounters ;; lcov -d $upx_BUILDDIR --zerocounters
esac fi
$upx --version $upx --version
$upx --help $upx --help
@ -102,7 +102,7 @@ for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do
rm -rf ./t rm -rf ./t
done done
case $BUILD_METHOD in coverage | coverage+* | *+coverage | *+coverage+*) if [[ $B =~ (^|\+)coverage($|\+) ]]; then
if [[ -n $TRAVIS_JOB_ID ]]; then if [[ -n $TRAVIS_JOB_ID ]]; then
cd $upx_SRCDIR || exit 1 cd $upx_SRCDIR || exit 1
coveralls -b $upx_BUILDDIR --gcov-options '\-lp' || true coveralls -b $upx_BUILDDIR --gcov-options '\-lp' || true
@ -113,7 +113,6 @@ case $BUILD_METHOD in coverage | coverage+* | *+coverage | *+coverage+*)
cd $lcov_OUTPUTDIR || exit 1 cd $lcov_OUTPUTDIR || exit 1
genhtml upx.info genhtml upx.info
fi fi
;; fi
esac
exit $exit_code exit $exit_code

View File

@ -47,10 +47,6 @@ matrix:
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-4.6-m64 env: C=gcc-4.6-m64
- os: linux
compiler: gcc
env: C=gcc-4.6-m64 B=coverage
addons: { apt: { packages: [ lcov ] } }
- os: linux - os: linux
compiler: gcc compiler: gcc
env: C=gcc-5-m32 env: C=gcc-5-m32
@ -176,16 +172,16 @@ install:
- | - |
cd / cd /
if [[ $TRAVIS_OS_NAME == linux ]]; then if [[ $TRAVIS_OS_NAME == linux ]]; then
case $B in coverage | coverage+* | *+coverage | *+coverage+*) if [[ $B =~ (^|\+)coverage($|\+) ]]; then
travis_retry pip install --user cpp-coveralls ;; travis_retry pip install --user cpp-coveralls
esac fi
fi fi
if [[ $TRAVIS_OS_NAME == osx ]]; then if [[ $TRAVIS_OS_NAME == osx ]]; then
if ! gsha256sum </bin/sh >/dev/null 2>/dev/null; then travis_retry brew install coreutils; fi if ! gsha256sum </bin/sh >/dev/null 2>/dev/null; then travis_retry brew install coreutils; fi
case $B in coverage | coverage+* | *+coverage | *+coverage+*) if [[ $B =~ (^|\+)coverage($|\+) ]]; then
travis_retry brew install lcov travis_retry brew install lcov
travis_retry pip install --user cpp-coveralls ;; travis_retry pip install --user cpp-coveralls
esac fi
fi fi
script: script: