[PATCH 0/1] [gdb/testsuite] Run test-case with all host/target boards

Tom de Vries via Gdb-patches
2023-04-03T15:10:52Z

Directory gdb/testsuite/boards contains a number of host/target boards, which
run a test-case (or test-cases) in a different way.

The benefits of using these boards are:
- improving test coverage of gdb,
- making the testsuite more robust, and
- making sure the test-cases work for non-native and remote setups.

Each board is slightly different, and developers need to learn how to use each
one, what parameters to pass and how, which ones can be using in combination
with each other. This is a threshold to start using them.

And then there quite a few, so typically only a few will be used by each
developer (I think).

This patch makes it possible to run a test-case with all the boards, using a
single invocation. The script is designed as a make check drop-in
replacement (though in the strictest sense it's not, because it doesn't use
RUNTESTFLAGS).

An example make check use is:
...
$ cd build/gdb/testsuite
$ make check RUNTESTFLAGS=gdb.base/advance.exp
...
=== gdb Summary ===

# of expected passes 8
gdb version 14.0.50.20230403-git -nw -nx -iex "set height 0" \
-iex "set width 0" -data-directory ./build/gdb/data-directory
...

And an example of make-check-all.sh for the same test-case is:
...
$ ~/gdb/src/gdb/contrib/make-check-all.sh gdb.base/advance.exp
LOCAL:
# of expected passes 8
TARGET BOARD: cc-with-gdb-index
# of expected passes 8
TARGET BOARD: cc-with-debug-names
# of expected passes 8
TARGET BOARD: cc-with-dwz
# of expected passes 8
TARGET BOARD: cc-with-dwz-m
# of expected passes 8
TARGET BOARD: cc-with-gnu-debuglink
# of expected passes 8
TARGET BOARD: debug-types
# of expected passes 8
TARGET BOARD: dwarf4-gdb-index
# of expected passes 8
TARGET BOARD: dwarf64
# of untested testcases 1
TARGET BOARD: fission
# of expected passes 8
TARGET BOARD: fission-dwp
# of expected passes 8
TARGET BOARD: gold
# of expected passes 8
TARGET BOARD: gold-gdb-index
# of expected passes 8
TARGET BOARD: readnow
# of expected passes 8
TARGET BOARD: stabs
# of expected passes 8
TARGET BOARD: native-extended-gdbserver
# of expected passes 8
TARGET BOARD: native-gdbserver
# of expected passes 8
TARGET BOARD: native-stdio-gdbserver
# of expected passes 8
TARGET BOARD: remote-gdbserver-on-localhost
# of expected passes 8
TARGET BOARD: remote-stdio-gdbserver
# of expected passes 8
HOST BOARD: local-remote-host, TARGET BOARD: remote-gdbserver-on-localhost
# of expected passes 8
HOST BOARD: local-remote-host, TARGET BOARD: remote-stdio-gdbserver
# of expected passes 8
HOST BOARD: local-remote-host-notty, TARGET BOARD: remote-gdbserver-on-localhost
# of expected passes 8
HOST BOARD: local-remote-host-notty, TARGET BOARD: remote-stdio-gdbserver
# of expected passes 8
HOST/TARGET BOARD: local-remote-host-native
# of expected passes 8
...

Note that the dwarf64 board doesn't work, because my system compiler is gcc
7.5.0, which doesn't support -gdwarf64.

An annoying property of the remote host/target boards is that they dump
files into the home dir. This problem can be worked around by using the
--host-user and --target-user switches, in combination with test accounts.

Using the test accounts has the additional benefit that it triggers more strict
checking of build/host/target file manipulations.

Tom de Vries (1):
[gdb/contrib] Add make-check-all.sh

gdb/contrib/make-check-all.sh | 255 ++++++++++++++++++++++++++++++++++
1 file changed, 255 insertions(+)
create mode 100755 gdb/contrib/make-check-all.sh

base-commit: 2e411b8c68eb2b035b31d5b00d940d4be1a0928b
--
2.35.3