mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
ece5bc8ac3
I found myself wanting to run a few specific selftests while developing. I thought it would be nice to be able to provide multiple test names when running `maintenant selftests`. The arguments to that command is currently interpreted as a single filter (not split by spaces), it now becomes a list a filters, split by spaces. A test is executed when it matches at least one filter. Here's an example of the result in GDB: (gdb) maintenance selftest xml Running selftest xml_escape_text. Running selftest xml_escape_text_append. Ran 2 unit tests, 0 failed (gdb) maintenance selftest xml unord Running selftest unordered_remove. Running selftest xml_escape_text. Running selftest xml_escape_text_append. Ran 3 unit tests, 0 failed (gdb) maintenance selftest xml unord foobar Running selftest unordered_remove. Running selftest xml_escape_text. Running selftest xml_escape_text_append. Ran 3 unit tests, 0 failed Since the selftest machinery is also shared with gdbserver, I also adapted gdbserver. It accepts a `--selftest` switch, which accepts an optional filter argument. I made it so you can now pass `--selftest` multiple time to add filters. It's not so useful right now though: there's only a single selftest right now in GDB and it's for an architecture I can't compile. So I tested by adding dummy tests, here's an example of the result: $ ./gdbserver --selftest=foo Running selftest foo. foo Running selftest foobar. foobar Ran 2 unit tests, 0 failed $ ./gdbserver --selftest=foo --selftest=bar Running selftest bar. bar Running selftest foo. foo Running selftest foobar. foobar Ran 3 unit tests, 0 failed gdbsupport/ChangeLog: * selftest.h (run_tests): Change parameter to array_view. * selftest.c (run_tests): Change parameter to array_view and use it. gdb/ChangeLog: * maint.c (maintenance_selftest): Split args and pass array_view to run_tests. gdbserver/ChangeLog: * server.cc (captured_main): Accept multiple `--selftest=` options. Pass all `--selftest=` arguments to run_tests. Change-Id: I422bd49f08ea8095ae174c5d66a2dd502a59613a |
||
---|---|---|
.. | ||
.dir-locals.el | ||
.gitattributes | ||
acinclude.m4 | ||
aclocal.m4 | ||
agent.cc | ||
agent.h | ||
alt-stack.h | ||
array-view.h | ||
ax.def | ||
block-signals.h | ||
break-common.h | ||
btrace-common.cc | ||
btrace-common.h | ||
buffer.cc | ||
buffer.h | ||
byte-vector.h | ||
ChangeLog | ||
check-defines.el | ||
cleanups.cc | ||
cleanups.h | ||
common-debug.cc | ||
common-debug.h | ||
common-defs.h | ||
common-exceptions.cc | ||
common-exceptions.h | ||
common-gdbthread.h | ||
common-inferior.cc | ||
common-inferior.h | ||
common-regcache.cc | ||
common-regcache.h | ||
common-types.h | ||
common-utils.cc | ||
common-utils.h | ||
common.m4 | ||
config.in | ||
configure | ||
configure.ac | ||
create-version.sh | ||
def-vector.h | ||
default-init-alloc.h | ||
enum-flags.h | ||
environ.cc | ||
environ.h | ||
errors.cc | ||
errors.h | ||
event-loop.cc | ||
event-loop.h | ||
fileio.cc | ||
fileio.h | ||
filestuff.cc | ||
filestuff.h | ||
filtered-iterator.h | ||
format.cc | ||
format.h | ||
forward-scope-exit.h | ||
function-view.h | ||
gdb_assert.h | ||
gdb_binary_search.h | ||
gdb_locale.h | ||
gdb_optional.h | ||
gdb_proc_service.h | ||
gdb_ref_ptr.h | ||
gdb_select.h | ||
gdb_setjmp.h | ||
gdb_signals.h | ||
gdb_splay_tree.h | ||
gdb_string_view.h | ||
gdb_string_view.tcc | ||
gdb_sys_time.h | ||
gdb_tilde_expand.cc | ||
gdb_tilde_expand.h | ||
gdb_unique_ptr.h | ||
gdb_unlinker.h | ||
gdb_vecs.cc | ||
gdb_vecs.h | ||
gdb_wait.cc | ||
gdb_wait.h | ||
gdb-dlfcn.cc | ||
gdb-dlfcn.h | ||
gdb-safe-ctype.h | ||
gdb-sigmask.h | ||
hash_enum.h | ||
host-defs.h | ||
job-control.cc | ||
job-control.h | ||
Makefile.am | ||
Makefile.in | ||
netstuff.cc | ||
netstuff.h | ||
new-op.cc | ||
next-iterator.h | ||
observable.h | ||
offset-type.h | ||
parallel-for.h | ||
pathstuff.cc | ||
pathstuff.h | ||
poison.h | ||
preprocessor.h | ||
print-utils.cc | ||
print-utils.h | ||
ptid.cc | ||
ptid.h | ||
README | ||
refcounted-object.h | ||
rsp-low.cc | ||
rsp-low.h | ||
run-time-clock.cc | ||
run-time-clock.h | ||
safe-iterator.h | ||
safe-strerror.cc | ||
scope-exit.h | ||
scoped_fd.h | ||
scoped_mmap.cc | ||
scoped_mmap.h | ||
scoped_restore.h | ||
selftest.cc | ||
selftest.h | ||
selftest.m4 | ||
signals-state-save-restore.cc | ||
signals-state-save-restore.h | ||
signals.cc | ||
symbol.h | ||
tdesc.cc | ||
tdesc.h | ||
thread-pool.cc | ||
thread-pool.h | ||
traits.h | ||
underlying.h | ||
valid-expr.h | ||
version.h | ||
warning.m4 | ||
x86-xstate.h | ||
xml-utils.cc | ||
xml-utils.h |
This is a helper library that is used by gdb and gdbserver. To send patches, follow the gdb patch submission instructions in ../gdb/CONTRIBUTE. For maintainers, see ../gdb/MAINTAINERS.