From 767f3676ed5798d9277ca2541f8a6bd266f7a31a Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sat, 16 Mar 2024 18:02:01 +0100 Subject: [PATCH] [wip] rewrite smoke test --- .github/workflows/build.yml | 2 +- scripts/ci/smoke-test.sh | 44 ++++++++++++------------------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f45069a..8dcb08d3 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 7688091b..62c8c6a8 100755 --- a/scripts/ci/smoke-test.sh +++ b/scripts/ci/smoke-test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -LET_IT_SMOKE=y +: ${LABWC_RUNS:=1} if ! test -x "$1/labwc"; then echo "$1/labwc not found" @@ -41,35 +41,19 @@ gdb_run() { --args "${args[@]}" return $? } - -if test "$LET_IT_SMOKE" = "y"; then - ret=0 - for x in {1..20}; do - printf "Starting run %2s\n" $x - output=$(gdb_run 2>&1) - ret=$? - if test $ret -ne 0; then - echo "Crash enountered:" - echo "-----------------" - echo "$output" - break - fi - done - exit $ret -fi - -echo "Starting ${args[@]}" -output=$("${args[@]}" 2>&1) -ret=$? - -if test $ret -ge 128; then - echo - echo "labwc crashed, restarting under gdb" - echo - gdb_run -else - echo "$output" -fi +echo "running with $LABWC_RUNS 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