CI: run test-suite; remove obsolete scripts
This commit is contained in:
parent
5dc4eb4b03
commit
9b87ddb621
93
.github/travis_build.sh
vendored
93
.github/travis_build.sh
vendored
@ -1,93 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
## vim:set ts=4 sw=4 et:
|
|
||||||
set -e; set -o pipefail
|
|
||||||
|
|
||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
|
||||||
|
|
||||||
# ...lots of outdated/unneeded stuff from the old Travis/Circle/AppVeyor CI days...
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
# create dirs
|
|
||||||
cd / || exit 1
|
|
||||||
mkbuilddirs $upx_BUILDDIR $ucl_BUILDDIR $upx_testsuite_BUILDDIR $zlib_BUILDDIR
|
|
||||||
cd / && cd "$upx_SRCDIR" || exit 1
|
|
||||||
|
|
||||||
echo
|
|
||||||
print_settings
|
|
||||||
echo
|
|
||||||
echo "$CC --version"; $CC --version
|
|
||||||
echo "$CXX --version"; $CXX --version
|
|
||||||
echo
|
|
||||||
|
|
||||||
# check whitespace
|
|
||||||
if [[ $TRAVIS_OS_NAME == linux ]]; then
|
|
||||||
cd / && cd $upx_SRCDIR || exit 1
|
|
||||||
echo "Checking source code for whitespace violations..."
|
|
||||||
bash ./misc/scripts/check_whitespace.sh || exit 1
|
|
||||||
echo " Passed."
|
|
||||||
fi # linux
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
#
|
|
||||||
# rebuild UPX stubs (needs upx-stubtools)
|
|
||||||
#
|
|
||||||
|
|
||||||
if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then
|
|
||||||
if [[ -f "$HOME/local/bin/bin-upx/upx-stubtools-check-version" ]]; then
|
|
||||||
bin_upx=$(readlink -en -- "$HOME/local/bin/bin-upx")
|
|
||||||
elif [[ -f "$HOME/.local/bin/bin-upx/upx-stubtools-check-version" ]]; then
|
|
||||||
bin_upx=$(readlink -en -- "$HOME/.local/bin/bin-upx")
|
|
||||||
else
|
|
||||||
bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20221212")
|
|
||||||
fi
|
|
||||||
cd / && cd "$upx_SRCDIR" || exit 1
|
|
||||||
extra_subdirs=()
|
|
||||||
extra_subdirs+=( src/stub/src/arch/amd64 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/arm/v4a )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/arm/v4t )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/arm64/v8 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/i386 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/m68k/m68000 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/m68k/m68020 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/mips/r3000 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/powerpc/32 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/powerpc/64 )
|
|
||||||
extra_subdirs+=( src/stub/src/arch/powerpc/64le )
|
|
||||||
make -C src/stub maintainer-clean
|
|
||||||
for d in ${extra_subdirs[@]}; do
|
|
||||||
make -C $d -f Makefile.extra maintainer-clean
|
|
||||||
git status $d || true
|
|
||||||
done
|
|
||||||
git status src/stub/src || true
|
|
||||||
git status || true
|
|
||||||
failed=0
|
|
||||||
for d in ${extra_subdirs[@]}; do
|
|
||||||
PATH="$bin_upx:$PATH" make -C $d -f Makefile.extra || failed=1
|
|
||||||
done
|
|
||||||
PATH="$bin_upx:$PATH" make -C src/stub all || failed=1
|
|
||||||
if [[ $failed != 0 ]]; then
|
|
||||||
echo "UPX-ERROR: FATAL: rebuild-stubs failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if ! git diff --quiet; then
|
|
||||||
git status || true
|
|
||||||
git diff || true
|
|
||||||
echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
git status
|
|
||||||
if [[ $BM_X == rebuild-stubs ]]; then
|
|
||||||
echo "X=rebuild-stubs done. Exiting."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
unset bin_upx extra_subdirs d failed
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
273
.github/travis_init.sh
vendored
273
.github/travis_init.sh
vendored
@ -1,273 +0,0 @@
|
|||||||
## vim:set ts=4 sw=4 et:
|
|
||||||
|
|
||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
|
||||||
|
|
||||||
# ...lots of outdated/unneeded stuff from the old Travis/Circle/AppVeyor CI days...
|
|
||||||
|
|
||||||
#set -x # debug
|
|
||||||
umask 022
|
|
||||||
export GIT_PAGER=
|
|
||||||
|
|
||||||
# rename short variables to more readable Build-Matrix BM_ names
|
|
||||||
# C is COMPILER
|
|
||||||
# B is BUILD_OPTIONS
|
|
||||||
# T is TESTSUITE_OPTIONS
|
|
||||||
# X is EXTRA_OPTIONS
|
|
||||||
BM_CROSS=$CROSS; BM_C=$C; BM_B=$B; BM_T=$T; BM_X=$X
|
|
||||||
unset CROSS C B T X
|
|
||||||
[[ -z $BM_C ]] && BM_C=gcc
|
|
||||||
[[ -z $BM_B ]] && BM_B=release
|
|
||||||
|
|
||||||
# just in case, unset variable for passing extra UPX options
|
|
||||||
export UPX=
|
|
||||||
# un-export some vars
|
|
||||||
declare +x UPX_AUTOMATIC_BUILDS_SSL_KEY UPX_AUTOMATIC_BUILDS_SSL_IV
|
|
||||||
|
|
||||||
# compatibility wrappers
|
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
|
||||||
# use GNU coreutils ("brew install coreutils")
|
|
||||||
chmod() {
|
|
||||||
gchmod "$@"
|
|
||||||
}
|
|
||||||
date() {
|
|
||||||
gdate "$@"
|
|
||||||
}
|
|
||||||
readlink() {
|
|
||||||
greadlink "$@"
|
|
||||||
}
|
|
||||||
sha256sum() {
|
|
||||||
gsha256sum "$@"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
|
||||||
openssl() {
|
|
||||||
/usr/bin/openssl "$@"
|
|
||||||
}
|
|
||||||
sort() {
|
|
||||||
/usr/bin/sort "$@"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set CC and CXX from BM_C and BM_CROSS
|
|
||||||
if [[ -z $CC_OVERRIDE ]]; then
|
|
||||||
CC=false CXX=false SCAN_BUILD=false
|
|
||||||
AR=ar SIZE=size
|
|
||||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
|
||||||
BUILD_LOCAL_UCL=1
|
|
||||||
BUILD_LOCAL_ZLIB=1
|
|
||||||
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
|
||||||
fi
|
|
||||||
upx_exeext=.exe
|
|
||||||
# dir c:\cygwin
|
|
||||||
case $BM_C in
|
|
||||||
gcc-m32 | gcc-4.9-m32)
|
|
||||||
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
|
||||||
gcc-m64 | gcc-4.9-m64)
|
|
||||||
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
|
||||||
msvc | msvc-*)
|
|
||||||
AR="link -lib"; CC="cl"; CXX="cl" ;; # standard system compiler
|
|
||||||
esac
|
|
||||||
fi # APPVEYOR_JOB_ID
|
|
||||||
if [[ -n $BM_CROSS ]]; then
|
|
||||||
BUILD_LOCAL_UCL=1
|
|
||||||
BUILD_LOCAL_ZLIB=1
|
|
||||||
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
|
||||||
export upx_EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"
|
|
||||||
fi
|
|
||||||
cat /etc/os-release || true
|
|
||||||
if grep -E -q '^PRETTY_NAME="?Ubuntu .*12\.04' /etc/os-release; then
|
|
||||||
case $BM_CROSS-$BM_C in
|
|
||||||
arm-linux-gnueabi-gcc | arm-linux-gnueabi-gcc-4.6)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabi"
|
|
||||||
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
|
||||||
arm-linux-gnueabihf-gcc | arm-linux-gnueabihf-gcc-4.6)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabihf"
|
|
||||||
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc"; CXX="$x-g++" ;;
|
|
||||||
i[36]86-w64-mingw32-gcc | i[36]86-w64-mingw32-gcc-4.6)
|
|
||||||
upx_exeext=.exe
|
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine"
|
|
||||||
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
|
||||||
x86_64-w64-mingw32-gcc | x86_64-w64-mingw32-gcc-4.6)
|
|
||||||
upx_exeext=.exe
|
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine"
|
|
||||||
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
|
||||||
esac
|
|
||||||
elif grep -E -q '^PRETTY_NAME="?Ubuntu 16\.04' /etc/os-release; then
|
|
||||||
case $BM_CROSS-$BM_C in
|
|
||||||
aarch64-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-aarch64 -L /usr/aarch64-linux-gnu"
|
|
||||||
x=aarch64-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
arm-linux-gnueabi-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabi"
|
|
||||||
x=arm-linux-gnueabi; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
arm-linux-gnueabihf-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-arm -L /usr/arm-linux-gnueabihf"
|
|
||||||
x=arm-linux-gnueabihf; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
i[36]86-w64-mingw32-gcc-5)
|
|
||||||
upx_exeext=.exe
|
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine"
|
|
||||||
x=i686-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m32"; CXX="$x-g++ -m32" ;;
|
|
||||||
mips-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-mips -L /usr/mips-linux-gnu"
|
|
||||||
x=mips-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
mipsel-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-mipsel -L /usr/mipsel-linux-gnu"
|
|
||||||
x=mipsel-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
powerpc-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc -L /usr/powerpc-linux-gnu"
|
|
||||||
x=powerpc-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
powerpc64-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc64 -L /usr/powerpc64-linux-gnu"
|
|
||||||
x=powerpc64-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
powerpc64le-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-ppc64le -L /usr/powerpc64le-linux-gnu"
|
|
||||||
x=powerpc64le-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
s390x-linux-gnu-gcc-5)
|
|
||||||
[[ -z $upx_qemu ]] && upx_qemu="qemu-s390x -L /usr/s390x-linux-gnu"
|
|
||||||
x=s390x-linux-gnu; AR="$x-ar"; CC="$x-gcc-5"; CXX="$x-g++-5" ;;
|
|
||||||
x86_64-w64-mingw32-gcc-5)
|
|
||||||
upx_exeext=.exe
|
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine"
|
|
||||||
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
|
||||||
esac
|
|
||||||
elif grep -E -q '^PRETTY_NAME="?Ubuntu 20\.04' /etc/os-release; then
|
|
||||||
case $BM_CROSS-$BM_C in
|
|
||||||
x86_64-w64-mingw32-gcc-9)
|
|
||||||
export upx_EXTRA_CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1"
|
|
||||||
export upx_EXTRA_LDFLAGS="-static"
|
|
||||||
upx_exeext=.exe
|
|
||||||
[[ -z $upx_wine ]] && upx_wine="wine64"
|
|
||||||
x=x86_64-w64-mingw32; AR="$x-ar"; CC="$x-gcc -m64"; CXX="$x-g++ -m64" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
fi # BM_CROSS
|
|
||||||
if [[ $CC == "false" ]]; then # generic
|
|
||||||
if [[ -z $BM_CROSS ]]; then
|
|
||||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
|
||||||
case $BM_C in
|
|
||||||
clang | clang-m?? | clang-[6789][0-9][0-9]-m?? | clang-1[0-1][0-9][0-9]-m??)
|
|
||||||
CC="clang"; CXX="clang++" ;; # standard system compiler
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
case $BM_C in
|
|
||||||
clang | clang-m?? | clang-3.4-m??)
|
|
||||||
CC="clang"; CXX="clang++" ;; # standard system compiler
|
|
||||||
clang-[3456].[0-9]-m??)
|
|
||||||
v=${BM_C:6:3}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
|
||||||
clang-[789]-m??)
|
|
||||||
v=${BM_C:6:1}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
|
||||||
clang-1[0-9]-m??)
|
|
||||||
v=${BM_C:6:2}; CC="clang-$v"; CXX="clang++-$v"; SCAN_BUILD="scan-build-$v" ;;
|
|
||||||
gcc | gcc-m?? | gcc-mx32)
|
|
||||||
CC="gcc"; CXX="g++" ;; # standard system compiler
|
|
||||||
gcc-[34].[0-9]-m?? | gcc-[34].[0-9]-mx32)
|
|
||||||
v=${BM_C:4:3}; CC="gcc-$v"; CXX="g++-$v" ;;
|
|
||||||
gcc-[56789]-m?? | gcc-[56789]-mx32)
|
|
||||||
v=${BM_C:4:1}; CC="gcc-$v"; CXX="g++-$v" ;;
|
|
||||||
gcc-1[0-9]-m?? | gcc-1[0-9]-mx32)
|
|
||||||
v=${BM_C:4:2}; CC="gcc-$v"; CXX="g++-$v" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
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" ;;
|
|
||||||
gcc*-mx32) CC="$CC -mx32"; CXX="$CXX -mx32"; BUILD_LOCAL_UCL=1; BUILD_LOCAL_ZLIB=1 ;;
|
|
||||||
esac
|
|
||||||
if [[ $BM_C =~ (^|\-)(clang|gcc)($|\-) ]]; then
|
|
||||||
CC="$CC -std=gnu89"
|
|
||||||
fi
|
|
||||||
unset v x
|
|
||||||
export AR CC CXX
|
|
||||||
fi # CC_OVERRIDE
|
|
||||||
|
|
||||||
# source dirs
|
|
||||||
[[ -z $upx_SRCDIR ]] && upx_SRCDIR=$(readlink -mn -- $argv0dir/..)
|
|
||||||
[[ -z $ucl_SRCDIR ]] && ucl_SRCDIR=$(readlink -mn -- $upx_SRCDIR/../deps/ucl-1.03)
|
|
||||||
[[ -z $upx_testsuite_SRCDIR ]] && upx_testsuite_SRCDIR=$(readlink -mn -- $upx_SRCDIR/../deps/upx-testsuite)
|
|
||||||
[[ -z $zlib_SRCDIR ]] && zlib_SRCDIR=$(readlink -mn -- $upx_SRCDIR/../deps/zlib-1.2.11)
|
|
||||||
|
|
||||||
# build dirs
|
|
||||||
mkbuilddirs() {
|
|
||||||
local d
|
|
||||||
for d in "$@"; do
|
|
||||||
mkdir -p -v "$d" || exit 1
|
|
||||||
[[ -f "$d/.mfxnobackup" ]] || touch "$d/.mfxnobackup"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
# search for an existing $toptop_builddir
|
|
||||||
if [[ -z $toptop_builddir ]]; then
|
|
||||||
for d in . ..; do
|
|
||||||
for subdir in "local" appveyor circle github gitlab travis .; do
|
|
||||||
dd=$d/build/$subdir
|
|
||||||
if [[ -d $dd ]]; then
|
|
||||||
toptop_builddir=$(readlink -en -- "$dd")
|
|
||||||
break 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
unset d subdir dd
|
|
||||||
fi
|
|
||||||
[[ -z $toptop_builddir ]] && toptop_builddir=$(readlink -mn -- ./build)
|
|
||||||
[[ -z $toptop_bdir ]] && toptop_bdir=$(readlink -mn -- "$toptop_builddir/${BM_CROSS:+$BM_CROSS-}$BM_C/$BM_B")
|
|
||||||
[[ -z $upx_BUILDDIR ]] && upx_BUILDDIR=$(readlink -mn -- "$toptop_bdir/upx")
|
|
||||||
[[ -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 $zlib_BUILDDIR ]] && zlib_BUILDDIR=$(readlink -mn -- "$toptop_bdir/zlib-1.2.11")
|
|
||||||
[[ -z $lcov_OUTPUTDIR ]] && lcov_OUTPUTDIR=$(readlink -mn -- "$toptop_bdir/.lcov-results")
|
|
||||||
unset toptop_builddir toptop_bdir
|
|
||||||
|
|
||||||
# ensure absolute directories
|
|
||||||
make_absolute() {
|
|
||||||
local d
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
if [[ -n ${!1} ]]; then
|
|
||||||
d=$(readlink -mn -- "${!1}")
|
|
||||||
eval $1="$d"
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
for var_prefix in ucl upx upx_testsuite zlib; do
|
|
||||||
for var_suffix in _BUILDDIR _SRCDIR; do
|
|
||||||
make_absolute ${var_prefix}${var_suffix}
|
|
||||||
done
|
|
||||||
done
|
|
||||||
make_absolute lcov_OUTPUTDIR
|
|
||||||
unset var_prefix var_suffix
|
|
||||||
|
|
||||||
print_header() {
|
|
||||||
local x='==========='; x="$x$x$x$x$x$x$x"
|
|
||||||
echo -e "\n${x}\n${1}\n${x}\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
print_settings() {
|
|
||||||
local v var_prefix var_suffix
|
|
||||||
# Build Matrix
|
|
||||||
for v in TRAVIS_OS_NAME BM_CROSS BM_C BM_B BM_T; do
|
|
||||||
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
|
||||||
done
|
|
||||||
# BM_C related
|
|
||||||
for v in AR CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS LIBS SCAN_BUILD; do
|
|
||||||
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
|
||||||
v=EXTRA_${v}
|
|
||||||
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
|
||||||
done
|
|
||||||
# directories and other info
|
|
||||||
for v in TRAVIS_XCODE_SDK UPX_UCLDIR lcov_OUTPUTDIR; do
|
|
||||||
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
|
||||||
done
|
|
||||||
for var_prefix in ucl upx upx_testsuite zlib; do
|
|
||||||
for var_suffix in _BUILDDIR _SRCDIR; do
|
|
||||||
v=${var_prefix}${var_suffix}
|
|
||||||
[[ -n ${!v} ]] && echo "${v}='${!v}'"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
##env | LC_ALL=C sort
|
|
||||||
}
|
|
||||||
|
|
||||||
true
|
|
||||||
43
.github/travis_testsuite_1.sh
vendored
43
.github/travis_testsuite_1.sh
vendored
@ -1,40 +1,29 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
## vim:set ts=4 sw=4 et:
|
## vim:set ts=4 sw=4 et:
|
||||||
set -e; set -o pipefail
|
set -e; set -o pipefail
|
||||||
|
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||||
|
|
||||||
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
|
# very first version of the upx-testsuite; requires:
|
||||||
|
# $upx_exe
|
||||||
#
|
# $upx_testsuite_SRCDIR
|
||||||
# very first version of the upx-testsuite
|
# $upx_testsuite_BUILDDIR (optional)
|
||||||
#
|
# $BM_T (optional)
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
# convenience
|
# convenience
|
||||||
|
[[ -z $upx_testsuite_BUILDDIR ]] && upx_testsuite_BUILDDIR=./tmp-upx-testsuite
|
||||||
[[ -f $upx_exe ]] && upx_exe=$(readlink -en -- "$upx_exe")
|
[[ -f $upx_exe ]] && upx_exe=$(readlink -en -- "$upx_exe")
|
||||||
|
|
||||||
# create dirs
|
# make dirs absolute
|
||||||
cd / || exit 1
|
upx_testsuite_SRCDIR=$(readlink -en -- "$upx_testsuite_SRCDIR")
|
||||||
if [[ ! -d "$upx_testsuite_SRCDIR/files/packed" ]]; then
|
if [[ ! -d "$upx_testsuite_SRCDIR/files/packed" ]]; then
|
||||||
echo 'invalid or missing $upx_testsuite_SRCDIR:'
|
echo 'invalid or missing $upx_testsuite_SRCDIR:'
|
||||||
echo ' please git clone https://github.com/upx/upx-testsuite'
|
echo ' please git clone https://github.com/upx/upx-testsuite'
|
||||||
echo ' and set (export) the envvar upx_testsuite_SRCDIR to the local file path'
|
echo ' and set (export) the envvar upx_testsuite_SRCDIR to the local file path'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkbuilddirs "$upx_testsuite_BUILDDIR"
|
mkdir -p "$upx_testsuite_BUILDDIR"
|
||||||
|
upx_testsuite_BUILDDIR=$(readlink -en -- "$upx_testsuite_BUILDDIR")
|
||||||
|
|
||||||
cd / && cd "$upx_testsuite_BUILDDIR" || exit 1
|
cd / && cd "$upx_testsuite_BUILDDIR" || exit 1
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
@ -148,8 +137,6 @@ if [[ $BM_T =~ (^|\+)ALLOW_FAIL($|\+) ]]; then
|
|||||||
set +e
|
set +e
|
||||||
fi
|
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
|
if [[ -z $upx_exe ]]; then exit 1; fi
|
||||||
upx_run=$upx_exe
|
upx_run=$upx_exe
|
||||||
if [[ $BM_T =~ (^|\+)qemu($|\+) && -n $upx_qemu ]]; then
|
if [[ $BM_T =~ (^|\+)qemu($|\+) && -n $upx_qemu ]]; then
|
||||||
@ -170,10 +157,6 @@ if [[ $BM_T =~ (^|\+)valgrind($|\+) ]]; then
|
|||||||
upx_run="$upx_valgrind $upx_valgrind_flags $upx_exe"
|
upx_run="$upx_valgrind $upx_valgrind_flags $upx_exe"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $BM_B =~ (^|\+)coverage($|\+) ]]; then
|
|
||||||
(cd / && cd "$upx_BUILDDIR" && lcov -d . --zerocounters)
|
|
||||||
fi
|
|
||||||
|
|
||||||
export UPX="--prefer-ucl --no-color --no-progress"
|
export UPX="--prefer-ucl --no-color --no-progress"
|
||||||
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
|
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
|
||||||
export UPX_DEBUG_DOCTEST_VERBOSE=0
|
export UPX_DEBUG_DOCTEST_VERBOSE=0
|
||||||
@ -183,7 +166,7 @@ if ! $upx_run --version-short; then echo "UPX-ERROR: FATAL: upx --version-sho
|
|||||||
if ! $upx_run -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L 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
|
if ! $upx_run --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi
|
||||||
rm -rf ./testsuite_1
|
rm -rf ./testsuite_1
|
||||||
mkbuilddirs testsuite_1
|
mkdir testsuite_1
|
||||||
cd testsuite_1 || exit 1
|
cd testsuite_1 || exit 1
|
||||||
|
|
||||||
# /***********************************************************************
|
# /***********************************************************************
|
||||||
|
|||||||
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: 'Install extra packages'
|
- name: 'Install extra packages'
|
||||||
run: |
|
run: |
|
||||||
uname -a; pwd; id; umask
|
uname -a; pwd; id; umask
|
||||||
cd ..; mkdir -p deps; cd deps; mkdir packages
|
mkdir ../deps; cd ../deps; mkdir packages
|
||||||
# for ubuntu-22.04: install python2-minimal
|
# for ubuntu-22.04: install python2-minimal
|
||||||
##export DEBIAN_FRONTEND=noninteractive
|
##export DEBIAN_FRONTEND=noninteractive
|
||||||
##sudo apt-get update && sudo apt-get install -y --no-install-recommends python2-minimal
|
##sudo apt-get update && sudo apt-get install -y --no-install-recommends python2-minimal
|
||||||
@ -43,10 +43,6 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
- name: 'Rebuild and verify stubs'
|
- name: 'Rebuild and verify stubs'
|
||||||
run: |
|
|
||||||
env C=gcc X=rebuild-stubs TRAVIS_OS_NAME=linux bash ./.github/travis_build.sh
|
|
||||||
if ! git diff --quiet; then git diff; exit 1; fi
|
|
||||||
- name: 'Rebuild and verify stubs v2'
|
|
||||||
run: |
|
run: |
|
||||||
export PATH="$(readlink -fn ../deps/bin-upx-20221212/.):$PATH"
|
export PATH="$(readlink -fn ../deps/bin-upx-20221212/.):$PATH"
|
||||||
make -C src/stub maintainer-clean extra-clean
|
make -C src/stub maintainer-clean extra-clean
|
||||||
@ -80,6 +76,8 @@ jobs:
|
|||||||
- name: 'Check out code'
|
- name: 'Check out code'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
|
- name: 'Check out test suite'
|
||||||
|
run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite'
|
||||||
- name: 'Build cmake debug-gcc'
|
- name: 'Build cmake debug-gcc'
|
||||||
run: 'make build/debug-gcc'
|
run: 'make build/debug-gcc'
|
||||||
- name: 'Build cmake release-gcc'
|
- name: 'Build cmake release-gcc'
|
||||||
@ -118,6 +116,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make -C build/debug-gcc-m32 test
|
make -C build/debug-gcc-m32 test
|
||||||
make -C build/release-gcc-m32 test
|
make -C build/release-gcc-m32 test
|
||||||
|
- name: 'Run test suite release-gcc'
|
||||||
|
run: |
|
||||||
|
export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite)
|
||||||
|
(cd build/release-gcc && env upx_exe=./upx bash ../../.github/travis_testsuite_1.sh)
|
||||||
|
|
||||||
job-macos-cmake:
|
job-macos-cmake:
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
@ -134,6 +136,8 @@ jobs:
|
|||||||
- name: 'Check out code'
|
- name: 'Check out code'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
|
- name: 'Check out test suite'
|
||||||
|
run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite'
|
||||||
- name: 'Build cmake debug-gcc'
|
- name: 'Build cmake debug-gcc'
|
||||||
if: ${{ matrix.gcc != '' }}
|
if: ${{ matrix.gcc != '' }}
|
||||||
run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
||||||
@ -179,6 +183,9 @@ jobs:
|
|||||||
- name: 'Check out code'
|
- name: 'Check out code'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
|
- name: 'Check out test suite'
|
||||||
|
shell: bash
|
||||||
|
run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite'
|
||||||
- name: 'Inspect runner-image settings'
|
- name: 'Inspect runner-image settings'
|
||||||
# see https://github.com/actions/runner-images.git
|
# see https://github.com/actions/runner-images.git
|
||||||
if: ${{ false }}
|
if: ${{ false }}
|
||||||
@ -207,6 +214,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cmake --build build/debug --config Debug --target RUN_TESTS
|
cmake --build build/debug --config Debug --target RUN_TESTS
|
||||||
cmake --build build/release --config Release --target RUN_TESTS
|
cmake --build build/release --config Release --target RUN_TESTS
|
||||||
|
- name: 'Run test suite build/release'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite)
|
||||||
|
(cd build/release/Release && env upx_exe=./upx.exe bash ../../../.github/travis_testsuite_1.sh)
|
||||||
|
|
||||||
job-windows-toolchains:
|
job-windows-toolchains:
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
@ -228,7 +240,7 @@ jobs:
|
|||||||
- name: 'Check out code'
|
- name: 'Check out code'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
- name: 'Prepare sources'
|
- name: 'Prepare sources and Check out test suite'
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
where bash & where cat & where chmod & where cmp & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar & where touch
|
where bash & where cat & where chmod & where cmp & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar & where touch
|
||||||
@ -236,8 +248,7 @@ jobs:
|
|||||||
git --version & bash --version
|
git --version & bash --version
|
||||||
cd %H%
|
cd %H%
|
||||||
md build build\%C% deps
|
md build build\%C% deps
|
||||||
cd deps
|
git -C deps clone --depth=1 https://github.com/upx/upx-testsuite
|
||||||
git clone --depth=1 https://github.com/upx/upx-testsuite
|
|
||||||
- name: 'Set up Developer Command Prompt'
|
- name: 'Set up Developer Command Prompt'
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
with:
|
with:
|
||||||
@ -245,7 +256,7 @@ jobs:
|
|||||||
- name: 'Build'
|
- name: 'Build'
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
@REM setup directories following the VPATH build in travis_build.sh
|
@REM setup directories
|
||||||
where cl & where link
|
where cl & where link
|
||||||
set BDIR=%H%\build\%C%\%B%
|
set BDIR=%H%\build\%C%\%B%
|
||||||
md %BDIR% %BDIR%\ucl %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib
|
md %BDIR% %BDIR%\ucl %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib
|
||||||
@ -292,7 +303,9 @@ jobs:
|
|||||||
.\upx.exe -t upx_packed.exe
|
.\upx.exe -t upx_packed.exe
|
||||||
.\upx_packed.exe --version
|
.\upx_packed.exe --version
|
||||||
- name: 'Run test suite'
|
- name: 'Run test suite'
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
bash ./.github/travis_testsuite_1.sh
|
export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite)
|
||||||
|
(cd ../build/$C/$B/upx && env upx_exe=./upx.exe bash ../../../../upx/.github/travis_testsuite_1.sh)
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
# vim:set ts=2 sw=2 et:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user