diff options
author | jak1 <jak1@themanaworld.org> | 2023-04-07 16:51:54 +0200 |
---|---|---|
committer | jak1 <jak1@themanaworld.org> | 2023-04-07 16:52:34 +0200 |
commit | a6006f9c59dccb6af4bf9b3e192bdb829c54fe87 (patch) | |
tree | 4df48d2b9ee14d51d0d6428436c49ed29f4395cb /tools/ci/scripts | |
parent | 279c7ba28804960ae3b2ec0753b4c3a92d5a6ede (diff) | |
download | manaverse-a6006f9c59dccb6af4bf9b3e192bdb829c54fe87.tar.gz manaverse-a6006f9c59dccb6af4bf9b3e192bdb829c54fe87.tar.bz2 manaverse-a6006f9c59dccb6af4bf9b3e192bdb829c54fe87.tar.xz manaverse-a6006f9c59dccb6af4bf9b3e192bdb829c54fe87.zip |
sorting CI:
moved disabled jobs to 'tools/ci/disabled.gitlab-ci.yml'
added check before rm, removes a lot unnecessary noise form pipeline output (req. init.sh)
added N_RUNS to runtests.sh (without arg it runs 3 times the tests, given amount otherwise)
added gcc-12 job
Diffstat (limited to 'tools/ci/scripts')
-rwxr-xr-x | tools/ci/scripts/exit.sh | 2 | ||||
-rwxr-xr-x | tools/ci/scripts/init.sh | 28 | ||||
-rwxr-xr-x | tools/ci/scripts/rundyecmd.sh | 4 | ||||
-rwxr-xr-x | tools/ci/scripts/runtests.sh | 27 | ||||
-rwxr-xr-x | tools/ci/scripts/separateunittests.sh | 2 |
5 files changed, 38 insertions, 25 deletions
diff --git a/tools/ci/scripts/exit.sh b/tools/ci/scripts/exit.sh index 1f13618c1..d06219a4f 100755 --- a/tools/ci/scripts/exit.sh +++ b/tools/ci/scripts/exit.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -rm $ERRFILE +silent_rm $ERRFILE diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index f427be910..92becc23b 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -3,7 +3,13 @@ export dir=$(pwd) export ERRFILE=${dir}/logs/${LOGFILE} -rm ${ERRFILE} +function silent_rm { + if [[ -f "$1" ]]; then + rm "$1" + fi +} + +silent_rm ${ERRFILE} function do_init { $CC --version @@ -147,11 +153,11 @@ function check_error { } function run_configure_simple { - rm $ERRFILE + silent_rm $ERRFILE echo "autoreconf -i" autoreconf -i 2>$ERRFILE check_error $? - rm $ERRFILE + silent_rm $ERRFILE echo "./configure $*" ./configure $* 2>$ERRFILE check_error $? @@ -160,14 +166,14 @@ function run_configure_simple { function run_configure { run_configure_simple $* - rm $ERRFILE + silent_rm $ERRFILE cd po echo "make update-gmo" make update-gmo 2>$ERRFILE check_error $? cd .. - rm $ERRFILE + silent_rm $ERRFILE cd po echo "make update-po" make update-po 2>$ERRFILE @@ -176,14 +182,14 @@ function run_configure { } function run_cmake { - rm $ERRFILE + silent_rm $ERRFILE echo "cmake ." cmake . 2>$ERRFILE check_error $? } function run_make { - rm $ERRFILE + silent_rm $ERRFILE if [ "$JOBS" == "" ]; then export JOBS=2 echo "No JOBS defined" @@ -196,7 +202,7 @@ function run_make { } function run_make_check { - rm $ERRFILE + silent_rm $ERRFILE if [ "$JOBS" == "" ]; then export JOBS=2 echo "No JOBS defined" @@ -256,7 +262,7 @@ function run_check_warnings { } function run_h { - rm $ERRFILE + silent_rm $ERRFILE echo "$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h" $CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h 2>$ERRFILE DATA=$(cat $ERRFILE) @@ -268,7 +274,7 @@ function run_h { } function run_tarball { - rm $ERRFILE + silent_rm $ERRFILE echo "make dist-xz" make dist-xz 2>$ERRFILE check_error $? @@ -281,7 +287,7 @@ function run_tarball { } function run_mplint { - rm $ERRFILE + silent_rm $ERRFILE echo "mplint/src/mplint $*" mplint/src/mplint $* \ | grep -v "src/unittests/doctest.h" \ diff --git a/tools/ci/scripts/rundyecmd.sh b/tools/ci/scripts/rundyecmd.sh index fc399f822..00001452a 100755 --- a/tools/ci/scripts/rundyecmd.sh +++ b/tools/ci/scripts/rundyecmd.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash function testdye { - rm test1.png || true + silent_rm test1.png || true echo ./src/dyecmd "data/icons/manaplus.png|$1" test1.png ./src/dyecmd "data/icons/manaplus.png|$1" test1.png || exit 1 ls test1.png || exit 1 - rm test1.png || true + silent_rm test1.png || true } export SDL_VIDEODRIVER="dummy" diff --git a/tools/ci/scripts/runtests.sh b/tools/ci/scripts/runtests.sh index 9f0a6729f..528ea69cc 100755 --- a/tools/ci/scripts/runtests.sh +++ b/tools/ci/scripts/runtests.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +if [[ $1 != "" ]]; then + N_RUNS=$1 +else + N_RUNS=3 +fi + if [[ "$RUNFROMSHELL" != "" ]]; then if [[ ${CIRRUS_CI} != "true" ]]; then echo "Running from shell. Skipping run tests $*" @@ -21,18 +27,19 @@ export ASAN_OPTIONS=detect_stack_use_after_return=true:strict_init_order=true echo "clean config runs" n=0 while true; do - echo "run test ${n}" - rm "${HOME}/.config/mana/mana/config.xml" - rm "/root/.config/mana/mana/config.xml" - rm "${HOME}/.config/mana/mana/serverlistplus.xml" - rm "/root/.config/mana/mana/serverlistplus.xml" - rm "${HOME}/.local/share/mana/manaplus.log" - rm "/root/.local/share/mana/manaplus.log" + echo "run test ${n}/${N_RUNS}" + echo "clean configs and logs" + silent_rm "${HOME}/.config/mana/mana/config.xml" + silent_rm "/root/.config/mana/mana/config.xml" + silent_rm "${HOME}/.config/mana/mana/serverlistplus.xml" + silent_rm "/root/.config/mana/mana/serverlistplus.xml" + silent_rm "${HOME}/.local/share/mana/manaplus.log" + silent_rm "/root/.local/share/mana/manaplus.log" ./tools/ci/scripts/runtest.sh if [ "$?" != 0 ]; then exit 1 fi - if [[ $n -ge 3 ]]; then + if [[ $n -ge $N_RUNS ]]; then break fi sleep 5 @@ -45,8 +52,8 @@ echo "existing config runs" n=0 while true; do echo "run test ${n}" - rm "${HOME}/.local/share/mana/manaplus.log" - rm "/root/.local/share/mana/manaplus.log" + silent_rm "${HOME}/.local/share/mana/manaplus.log" + silent_rm "/root/.local/share/mana/manaplus.log" ./tools/ci/scripts/runtest.sh if [ "$?" != 0 ]; then exit 1 diff --git a/tools/ci/scripts/separateunittests.sh b/tools/ci/scripts/separateunittests.sh index 3e94272da..493ce4ab4 100755 --- a/tools/ci/scripts/separateunittests.sh +++ b/tools/ci/scripts/separateunittests.sh @@ -13,7 +13,7 @@ for str in $(cat ${LIST}) do unset IFS declare -a "arr=($str)" - rm -rf "${HOME}" + silent_rm -rf "${HOME}" mkdir "${HOME}" echo ./src/manaplustests --test-case=\"${arr[0]}\" --subcase=\"${arr[1]}\" ./src/manaplustests --test-case="${arr[0]}" --subcase="${arr[1]}" || exit 1 |