]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: fix failure in gdb.base/info_sources.exp
authorAndrew Burgess <aburgess@redhat.com>
Mon, 11 Nov 2024 10:51:46 +0000 (10:51 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 11 Nov 2024 15:29:53 +0000 (15:29 +0000)
commitf03239584d8d33689c19d68500b611ce8991626b
tree7d19cc5a55bd1af7c4826e721574a3ba87797221
parent7d88c8a06ce4077b235bf83a787e6aced84a7634
gdb/testsuite: fix failure in gdb.base/info_sources.exp

I ran into an unexpected failure in gdb.base/info_sources.exp.  The
test in question runs this command:

  (gdb) info sources -d -- -d

That is, list all the source files whose directory name matches the
regexp '-d'.  The expectation is that no source files will be listed.

Unfortunately, when I ran the test some source files are listed; the
directory I am running in contains the pattern '-d', and so the test
fails.

As we cannot control where the developer is building and testing GDB,
I propose that instead of just testing with '-d' we should search
through all the letters a-z and find one that isn't present in the
source file directory name.  I'm still including the leading '-'
character in the regexp.

So now, unless GDB is being built in a directory that contains '-a',
'-b', '-c', .... '-z', the test will find one letter which isn't
present, and use that for the test.

To avoid test names changing between runs in different directories
I've had to tweak the test name to something more generic, but there
should be no change in which parts of GDB are actually being tested.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.base/info_sources.exp