Gdb pretty printers (#8263)
This commit is contained in:
parent
217a2cf098
commit
97d37aeb0b
7 changed files with 638 additions and 3 deletions
15
tests/untestable/gdb/gdb_pretty_printer_test_run.sh
Executable file
15
tests/untestable/gdb/gdb_pretty_printer_test_run.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
# Exit if anything fails
|
||||
set -e
|
||||
#!/usr/bin/env bash
|
||||
# Compile the test project with fresh debug information.
|
||||
nim c --debugger:native gdb_pretty_printer_test_program.nim &> /dev/null
|
||||
# 2>&1 redirects stderr to stdout (all output in stdout)
|
||||
# <(...) is a bash feature that makes the output of a command into a
|
||||
# file handle.
|
||||
# diff compares the two files, the expected output, and the file
|
||||
# handle that is created by the execution of gdb.
|
||||
diff ./gdb_pretty_printer_test_output.txt <(gdb -x gdb_pretty_printer_test.py --batch-silent --args gdb_pretty_printer_test_program 2>&1)
|
||||
# The exit code of diff is forwarded as the exit code of this
|
||||
# script. So when the comparison fails, the exit code of this script
|
||||
# won't be 0. So this script should be embeddable in a test suite.
|
||||
Loading…
Add table
Add a link
Reference in a new issue