CI updates

This commit is contained in:
Markus F.X.J. Oberhumer
2023-09-11 06:52:57 +02:00
parent 0192b0b7e4
commit 57ad6bc37d
12 changed files with 94 additions and 67 deletions
+7 -2
View File
@@ -8,7 +8,7 @@ set -e
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# uses optional environment variables: AR, CC, CXX, OPTIMIZE, top_srcdir
# uses optional environment variables: AR, CC, CXX, OPTIMIZE, VERBOSE, top_srcdir
# shell init
### set -x # enable logging
@@ -62,7 +62,12 @@ run() {
fi
# print short info and run command
test "x$1" != "x" && test "x$1" != "x+" && echo "$1"
shift; "$@"
shift
if test "x$VERBOSE" != "x" && test "x$VERBOSE" != "x0"; then
# print full command
echo " $@"
fi
"$@"
}
# helper function
+11 -8
View File
@@ -8,12 +8,13 @@ argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
umask 0022
id || true
echo "PWD='$PWD'"
if [[ $UID == 0 || $EUID == 0 ]]; then
echo "ERROR: do not run as root: UID=$UID EUID=$EUID"
exit 91
fi
# test behaviour with symlinks; requires:
# test file system behaviour with symlinks; requires:
# $upx_exe (required, but with convenience fallback "./upx")
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Westmere" or "valgrind")
@@ -39,15 +40,19 @@ fi
upx_run+=( "$upx_exe" )
echo "upx_run='${upx_run[*]}'"
# upx_run check, part1
# upx_run check
if ! "${upx_run[@]}" --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short 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
#***********************************************************************
#
# util
#***********************************************************************
exit_code=0
num_errors=0
all_errors=
failed() {
####exit $1
# log error and keep going
@@ -97,6 +102,7 @@ assert_symlink_dangling() {
create_files() {
# clean
local d
for d in z_dir_1 z_dir_2 z_dir_3 z_dir_4; do
if [[ -d $d ]]; then
chmod -R +w "./$d"
@@ -137,16 +143,13 @@ create_files() {
#
#***********************************************************************
#set -x # debug
export UPX="--prefer-ucl --no-color --no-progress"
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
export UPX_DEBUG_DOCTEST_VERBOSE=0
export NO_COLOR=1
#set -x # debug
exit_code=0
num_errors=0
all_errors=
testsuite_header() {
local x='==========='; x="$x$x$x$x$x$x$x"
echo -e "\n${x}\n${1}\n${x}\n"