mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
[dirty] let it smoke
This commit is contained in:
parent
1597d683ca
commit
7124cf79c1
1 changed files with 32 additions and 8 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
LET_IT_SMOKE=y
|
||||
|
||||
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,6 +39,34 @@ if test $ret -ge 128; then
|
|||
-ex 'set listsize 50' \
|
||||
-ex list \
|
||||
--args "${args[@]}"
|
||||
return $?
|
||||
}
|
||||
|
||||
if test "$LET_IT_SMOKE" = "y"; then
|
||||
ret=0
|
||||
for x in {1..10}; 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue