Skip to content

Commit 4042ba1

Browse files
committed
ci: ask the system where a program that stopped without printing was
1 parent 541c153 commit 4042ba1

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,20 @@ jobs:
9696
extra=''
9797
[ -n '${{ matrix.target }}' ] && extra='--target ${{ matrix.target }}'
9898
mcpp build $extra
99-
"$(find target -type f \( -name 'posix' -o -name 'posix.exe' \) | head -1)" 2>&1 | tee run.log
99+
binary="$(find target -type f \( -name 'posix' -o -name 'posix.exe' \) | head -1)"
100+
# A program that stops without printing has told the reader nothing.
101+
# Where the system has a debugger, it is asked where the program was,
102+
# because "exit code 139" names a signal and not a place.
103+
if ! "$binary" > run.log 2>&1; then
104+
cat run.log
105+
if command -v lldb > /dev/null 2>&1; then
106+
lldb --batch -o run -o 'bt all' -o 'register read' -- "$binary" 2>&1 | tail -60 || true
107+
elif command -v gdb > /dev/null 2>&1; then
108+
gdb -batch -ex run -ex 'bt' --args "$binary" 2>&1 | tail -40 || true
109+
fi
110+
exit 1
111+
fi
112+
cat run.log
100113
# Both directions: that the program reported, and that nothing it
101114
# observed failed to hold. Asserting only the first would pass for a
102115
# program that printed its failures.

0 commit comments

Comments
 (0)