Update Travis and AppVeyor.
This commit is contained in:
+20
-8
@@ -4,6 +4,7 @@
|
|||||||
os: Visual Studio 2015
|
os: Visual Studio 2015
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
global: { C: "", B: release, ALLOW_FAIL: "", TRAVIS_OS_NAME: windows }
|
||||||
matrix:
|
matrix:
|
||||||
- { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 }
|
- { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 }
|
||||||
### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # AppVeyor: x64 compiler is not installed
|
### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # AppVeyor: x64 compiler is not installed
|
||||||
@@ -19,14 +20,15 @@ init:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- cd c:\projects
|
- cd c:\projects
|
||||||
- mkdir build build\%C% deps
|
- md 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
|
||||||
- appveyor DownloadFile "https://github.com/upx/upx/files/499379/ucl-1.03.tar.gz"
|
- appveyor DownloadFile "https://github.com/upx/upx/files/499379/ucl-1.03.tar.gz"
|
||||||
- appveyor DownloadFile "https://github.com/upx/upx/files/499381/zlib-1.2.8.tar.gz"
|
- appveyor DownloadFile "https://github.com/upx/upx/files/499381/zlib-1.2.8.tar.gz"
|
||||||
- tar -xzf ucl-1.03.tar.gz
|
- tar -xzf ucl-1.03.tar.gz
|
||||||
- sed -i '/snprintf *_v*snprintf/d' ucl-1.03/acc/acc_auto.h
|
# patch UCL for msvc-14.0 (vsnprintf issue)
|
||||||
|
- sed -i '/# *define.*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 "%C%"=="msvc-10.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 )
|
- if "%C%"=="msvc-10.0-x86" ( call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 )
|
||||||
@@ -39,30 +41,40 @@ install:
|
|||||||
- if "%C%"=="msvc-14.0-x64" ( call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 )
|
- 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
|
# setup directories following the VPATH build in travis_build.sh
|
||||||
- cd c:\projects\upx
|
- cd c:\projects\upx
|
||||||
# - if "%C%"=="gcc-m64" ( bash -x ./.github/travis_build.sh && exit 0 ) # TODO
|
##- if "%C%"=="gcc-m64" ( bash -x ./.github/travis_build.sh && exit 0 ) # TODO
|
||||||
- set DEFS=-D_CRT_SECURE_NO_WARNINGS
|
|
||||||
- set BDIR=c:\projects\build\%C%\%B%
|
- set BDIR=c:\projects\build\%C%\%B%
|
||||||
- mkdir %BDIR% %BDIR%\ucl-1.03 %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib-1.2.8
|
- md %BDIR% %BDIR%\ucl-1.03 %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib-1.2.8
|
||||||
|
- set DEFS=-D_CRT_SECURE_NO_WARNINGS
|
||||||
|
- git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt
|
||||||
|
# build UCL
|
||||||
- cd %BDIR%\ucl-1.03
|
- cd %BDIR%\ucl-1.03
|
||||||
- set s=c:\projects\deps\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
|
- 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
|
||||||
|
# build zlib
|
||||||
- cd %BDIR%\zlib-1.2.8
|
- cd %BDIR%\zlib-1.2.8
|
||||||
- cl -MT -O2 -W2 %DEFS% -c c:\projects\deps\zlib-1.2.8\*.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
|
||||||
|
# build UPX
|
||||||
- cd %BDIR%\upx
|
- cd %BDIR%\upx
|
||||||
- set s=c:\projects\upx\src
|
- 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
|
- cat .GITREV.txt
|
||||||
|
- set /p GITREV=<.GITREV.txt
|
||||||
|
- cl -MT -EHsc -O2 -W4 -wd4244 -DUPX_VERSION_GITREV="""%GITREV%""" %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:
|
||||||
|
- set UPX=--no-color --no-progress
|
||||||
- cd %BDIR%\upx
|
- cd %BDIR%\upx
|
||||||
|
# basic tests
|
||||||
- .\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
|
||||||
|
- .\upx.exe -l upx_packed.exe
|
||||||
|
- .\upx.exe -t upx_packed.exe
|
||||||
- .\upx_packed.exe --version
|
- .\upx_packed.exe --version
|
||||||
|
# now run the UPX testsuite using Cygwin bash - this really works!
|
||||||
- cd c:\projects\upx
|
- cd c:\projects\upx
|
||||||
- bash ./.github/travis_testsuite_1.sh
|
- bash ./.github/travis_testsuite_1.sh
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,13 @@
|
|||||||
#set -x # debug
|
#set -x # debug
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
|
# just in case
|
||||||
|
UPX=
|
||||||
|
|
||||||
# set CC and CXX from C
|
# set CC and CXX from C
|
||||||
CC=false CXX=false SCAN_BUILD=false
|
|
||||||
[[ -z $C ]] && C=gcc
|
[[ -z $C ]] && C=gcc
|
||||||
|
if [[ -z $CC_OVERRIDE ]]; then
|
||||||
|
CC=false CXX=false SCAN_BUILD=false
|
||||||
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??)
|
||||||
CC="clang"; CXX="clang++" ;; # standard system compiler
|
CC="clang"; CXX="clang++" ;; # standard system compiler
|
||||||
@@ -32,6 +36,7 @@ case $C in
|
|||||||
clang* | gcc*) CC="$CC -std=gnu89" ;;
|
clang* | gcc*) CC="$CC -std=gnu89" ;;
|
||||||
esac
|
esac
|
||||||
export CC CXX
|
export CC CXX
|
||||||
|
fi # CC_OVERRIDE
|
||||||
|
|
||||||
# B is BUILD_TYPE
|
# B is BUILD_TYPE
|
||||||
[[ -z $B ]] && B=release
|
[[ -z $B ]] && B=release
|
||||||
@@ -50,7 +55,7 @@ upx_testsuite_BUILDDIR="$tmake_top_bdir/upx-testsuite"
|
|||||||
lcov_OUTPUTDIR="$tmake_top_bdir/.lcov-results"
|
lcov_OUTPUTDIR="$tmake_top_bdir/.lcov-results"
|
||||||
|
|
||||||
mkdir -p -v $upx_BUILDDIR $ucl_BUILDDIR $upx_testsuite_BUILDDIR
|
mkdir -p -v $upx_BUILDDIR $ucl_BUILDDIR $upx_testsuite_BUILDDIR
|
||||||
[[ -d $tmake_top_bdir/.mfxnobackup ]] || echo "timestamp" > $tmake_top_bdir/.mfxnobackup
|
[[ -d $tmake_top_bdir/.mfxnobackup ]] && echo "timestamp" > $tmake_top_bdir/.mfxnobackup
|
||||||
|
|
||||||
export UPX_UCLDIR="$ucl_SRCDIR"
|
export UPX_UCLDIR="$ucl_SRCDIR"
|
||||||
|
|
||||||
@@ -63,7 +68,9 @@ cd / && cd $upx_BUILDDIR || exit 1
|
|||||||
# enter srcdir
|
# enter srcdir
|
||||||
cd / && cd $upx_SRCDIR || exit 1
|
cd / && cd $upx_SRCDIR || exit 1
|
||||||
|
|
||||||
|
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||||
# for some reason this is needed for bash on AppVeyor
|
# for some reason this is needed for bash on AppVeyor
|
||||||
sort() {
|
sort() {
|
||||||
/usr/bin/sort "$@"
|
/usr/bin/sort "$@"
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ source ./.github/travis_init.sh || exit 1
|
|||||||
# ************************************************************************/
|
# ************************************************************************/
|
||||||
|
|
||||||
testsuite_header() {
|
testsuite_header() {
|
||||||
local x="========"; x="$x$x$x$x$x$x$x$x$x"
|
local x="==========="; x="$x$x$x$x$x$x$x"
|
||||||
echo -e "\n${x}\n${1}\n${x}\n"
|
echo -e "\n${x}\n${1}\n${x}\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,26 +34,28 @@ testsuite_split_f() {
|
|||||||
|
|
||||||
testsuite_check_sha() {
|
testsuite_check_sha() {
|
||||||
(cd "$1" && $sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
(cd "$1" && $sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current
|
||||||
|
echo
|
||||||
cat $1/.sha256sums.current
|
cat $1/.sha256sums.current
|
||||||
if ! cmp -s $1/.sha256sums.current $1/.sha256sums.expected; then
|
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
|
||||||
echo "UPX-ERROR: checksum mismatch"
|
echo "UPX-ERROR: checksum mismatch"
|
||||||
diff -u $1/.sha256sums.current $1/.sha256sums.expected || true
|
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
|
||||||
#exit 1
|
#exit 1
|
||||||
exit_code=1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
testsuite_run_compress() {
|
testsuite_run_compress() {
|
||||||
testsuite_header "$t"
|
testsuite_header $t
|
||||||
local f ff
|
local f ff
|
||||||
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do
|
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do
|
||||||
testsuite_split_f "$f"
|
testsuite_split_f $f
|
||||||
[[ -z $fb ]] && continue
|
[[ -z $fb ]] && continue
|
||||||
mkdir -p $t/$fsubdir
|
mkdir -p $t/$fsubdir
|
||||||
ff=t01_decompressed/$fsubdir/$fb
|
ff=t01_decompressed/$fsubdir/$fb
|
||||||
$upx_exe --prefer-ucl "$@" $ff -o $t/$fsubdir/$fb
|
$upx_exe --prefer-ucl "$@" $ff -o $t/$fsubdir/$fb
|
||||||
done
|
done
|
||||||
testsuite_check_sha "$t"
|
testsuite_check_sha $t
|
||||||
$upx_exe -l $t/*/*
|
$upx_exe -l $t/*/*
|
||||||
$upx_exe --file-info $t/*/*
|
$upx_exe --file-info $t/*/*
|
||||||
$upx_exe -t $t/*/*
|
$upx_exe -t $t/*/*
|
||||||
@@ -75,8 +77,8 @@ if [[ ! -d $upx_testsuite_SRCDIR/files/packed ]]; then exit 1; fi
|
|||||||
|
|
||||||
[[ -z $upx_exe && -f $upx_BUILDDIR/upx.out ]] && upx_exe=$upx_BUILDDIR/upx.out
|
[[ -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
|
[[ -z $upx_exe && -f $upx_BUILDDIR/upx.exe ]] && upx_exe=$upx_BUILDDIR/upx.exe
|
||||||
if [[ ! -f $upx_exe ]]; then exit 1; fi
|
if [[ -z $upx_exe ]]; then exit 1; fi
|
||||||
if [[ ! -x $upx_exe ]]; then exit 1; fi
|
if ! $upx_exe --version >/dev/null; then exit 1; fi
|
||||||
|
|
||||||
sha256sum=sha256sum
|
sha256sum=sha256sum
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||||
@@ -99,7 +101,7 @@ mkdir testsuite_1
|
|||||||
cd testsuite_1
|
cd testsuite_1
|
||||||
|
|
||||||
export UPX=
|
export UPX=
|
||||||
export UPX="--no-progress"
|
export UPX="--no-color --no-progress"
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
@@ -119,14 +121,14 @@ c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.e
|
|||||||
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
|
||||||
" > $t/.sha256sums.expected
|
" > $t/.sha256sums.expected
|
||||||
|
|
||||||
testsuite_header "$t"
|
testsuite_header $t
|
||||||
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do
|
for f in $upx_testsuite_SRCDIR/files/packed/*/upx-3.91*; do
|
||||||
testsuite_split_f "$f"
|
testsuite_split_f $f
|
||||||
[[ -z $fb ]] && continue
|
[[ -z $fb ]] && continue
|
||||||
mkdir -p $t/$fsubdir
|
mkdir -p $t/$fsubdir
|
||||||
$upx_exe -d $f -o $t/$fsubdir/$fb
|
$upx_exe -d $f -o $t/$fsubdir/$fb
|
||||||
done
|
done
|
||||||
testsuite_check_sha "$t"
|
testsuite_check_sha $t
|
||||||
|
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user