diff options
Diffstat (limited to 'tools/ci')
-rwxr-xr-x | tools/ci/jobs/deheader.sh | 17 | ||||
-rwxr-xr-x | tools/ci/jobs/deheader2.sh | 29 | ||||
-rwxr-xr-x | tools/ci/jobs/deheader_sdl2.sh | 17 | ||||
-rwxr-xr-x | tools/ci/scripts/deheader.sh | 21 |
4 files changed, 84 insertions, 0 deletions
diff --git a/tools/ci/jobs/deheader.sh b/tools/ci/jobs/deheader.sh new file mode 100755 index 000000000..834d8b8b5 --- /dev/null +++ b/tools/ci/jobs/deheader.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +export LOGFILE2=deheader2.log + +source ./tools/ci/scripts/init.sh + +aptget_install python wget \ + gcc-5 g++-5 \ + libphysfs-dev \ + libxml2-dev libcurl4-gnutls-dev libpng-dev \ + libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev + +export dir=$(pwd) + +rm deheader +wget "https://gitlab.com/4144/deheader/raw/master/deheader" +chmod +x deheader diff --git a/tools/ci/jobs/deheader2.sh b/tools/ci/jobs/deheader2.sh new file mode 100755 index 000000000..94cf60cbe --- /dev/null +++ b/tools/ci/jobs/deheader2.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export LOGFILE2=deheader2.log + +export DATA=$(cat ${LOGFILE}) +if [[ -z "${DATA}" ]]; then + echo "Empty output. Probably wrong search flags." + exit 1 +fi + +export DATA=$(grep "error:" ${LOGFILE}) +if [[ -n "${DATA}" ]]; then + echo "Compilation error found" + exit 1 +fi + +grep "deheader:" ${LOGFILE} \ +| grep -v "deheader: remove <climits> from ./src/being/localplayer.cpp" \ +| grep -v "deheader: remove <fstream> from ./src/utils/files.cpp" \ +| grep -v "deheader: remove <climits> from ./src/resources/map/map.cpp" \ +| grep -v "deheader: remove <sys/time.h> from ./src/resources/wallpaper.cpp" \ +| grep -v "deheader: remove <climits> from ./src/units.cpp" > ${LOGFILE2} + +export DATA=$(cat ${LOGFILE2}) +if [[ -n "${DATA}" ]]; then + echo "Wrong include files found" + echo ${DATA} + exit 1 +fi diff --git a/tools/ci/jobs/deheader_sdl2.sh b/tools/ci/jobs/deheader_sdl2.sh new file mode 100755 index 000000000..2c7920956 --- /dev/null +++ b/tools/ci/jobs/deheader_sdl2.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +export LOGFILE2=deheader2.log + +source ./tools/ci/scripts/init.sh + +aptget_install python wget \ + gcc-5 g++-5 \ + libphysfs-dev \ + libxml2-dev libcurl4-gnutls-dev libpng-dev \ + libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev + +export dir=$(pwd) + +rm deheader +wget "https://gitlab.com/4144/deheader/raw/master/deheader" +chmod +x deheader diff --git a/tools/ci/scripts/deheader.sh b/tools/ci/scripts/deheader.sh new file mode 100755 index 000000000..4106b0308 --- /dev/null +++ b/tools/ci/scripts/deheader.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +export var=$1 +export name=${var%.*} +export name=${name#./src/} +export name=${name##*./}.h +export dir=$(pwd) + +echo $1 >>${LOGFILE} +echo $1 + +${dir}/deheader -q -i "\"debug.h\"" \ +-i "\"utils/checkutils.h\"" \ +-i "\"utils/sdlcheckutils.h\"" \ +-i "\"sdlshared.h\"" \ +-i "\"localconsts.h\"" \ +-i "\"utils/fuzzer.h\"" \ +-i "\"utils/physfscheckutils.h\"" \ +-i "\"$name\"" \ +-m "$CXX -c -std=gnu++1z -Werror -Wall -Wextra -Wundef -Wmissing-declarations -DLOCALEDIR=\\\"\\\" $FLAGS -I/usr/include $INCLUDES -I${dir}/src" $1 \ +| grep -v "portability requires" | tee -a ${LOGFILE} |