diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce83bb1a..eec6984d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -196,5 +196,5 @@ jobs: export CC=gcc meson setup build-gcc-ci -Dxwayland=enabled --werror meson compile -C build-gcc-ci - scripts/ci/smoke-test.sh build-gcc-ci + LABWC_RUNS=20 scripts/ci/smoke-test.sh build-gcc-ci ' | $TARGET diff --git a/scripts/ci/smoke-test.sh b/scripts/ci/smoke-test.sh index 89981af6..e366ceaf 100755 --- a/scripts/ci/smoke-test.sh +++ b/scripts/ci/smoke-test.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +: ${LABWC_RUNS:=1} + if ! test -x "$1/labwc"; then echo "$1/labwc not found" exit 1 @@ -14,11 +16,7 @@ args=( export XDG_RUNTIME_DIR=$(mktemp -d) export WLR_BACKENDS=headless -echo "Starting ${args[@]}" -output=$("${args[@]}" 2>&1) -ret=$? - -if test $ret -ge 128; then +gdb_run() { # Not using -Db_sanitize=address,undefined # because it slows down the usual execution # way too much and spams pages over pages @@ -30,10 +28,8 @@ if test $ret -ge 128; then # just running labwc again is a lot faster # anyway. - echo - echo "labwc crashed, restarting under gdb" - echo gdb --batch \ + --return-child-result \ -ex run \ -ex 'bt full' \ -ex 'echo \n' \ @@ -43,9 +39,23 @@ if test $ret -ge 128; then -ex 'set listsize 50' \ -ex list \ --args "${args[@]}" -else - echo "$output" -fi + return $? +} + +echo "Running with LABWC_RUNS=$LABWC_RUNS" + +ret=0 +for((i=1; i<=LABWC_RUNS; i++)); do + printf "Starting run %2s\n" $i + output=$(gdb_run 2>&1) + ret=$? + if test $ret -ne 0; then + echo "Crash encountered:" + echo "------------------" + echo "$output" + break + fi +done echo "labwc terminated with return code $ret" exit $ret