[gdb/testsuite] Remove read1 timeout factor from gdb.base/info-macros.exp
authorTom de Vries <tdevries@suse.de>
Tue, 6 Jul 2021 10:05:37 +0000 (12:05 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 6 Jul 2021 10:05:37 +0000 (12:05 +0200)
commit0d4e283965dae2c05cf0c85dccea6144a2c6293e
treee96abc679c483f14d263a9cab17177405d094f51
parent70a590636b4fcb0818233c65c92163254140a2fd
[gdb/testsuite] Remove read1 timeout factor from gdb.base/info-macros.exp

At the moment some check-read1 timeouts are handled like this in
gdb.base/info-macros.exp:
...
gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
  -re "$r1$r2$r3" {
     pass $testname
  }
  -re ".*#define TWO.*\r\n$gdb_prompt" {
     fail $testname
  }
  -re ".*#define THREE.*\r\n$gdb_prompt" {
     fail $testname
  }
  -re ".*#define FOUR.*\r\n$gdb_prompt" {
     fail $testname
  }
}
...
which is not ideal.

We could use gdb_test_lines, but it currently doesn't support verifying
the absence of regexps, which is done using the clauses above calling fail.

Fix this by using gdb_test_lines and adding a -re-not syntax to
gdb_test_lines, such that we can do:
...
gdb_test_lines $test $testname $r1.*$r2 \
    -re-not "#define TWO" \
    -re-not "#define THREE" \
    -re-not "#define FOUR"
...

Tested on x86_64-linux, whith make targets check and check-read1.

Also observed that check-read1 execution time is reduced from 6m35s to 13s.

gdb/testsuite/ChangeLog:

2021-07-06  Tom de Vries  <tdevries@suse.de>

* gdb.base/info-macros.exp: Replace use of
gdb_test_multiple_with_read1_timeout_factor with gdb_test_lines.
(gdb_test_multiple_with_read1_timeout_factor): Remove.
* lib/gdb.exp (gdb_test_lines): Add handling or -re-not <regexp>.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/info-macros.exp
gdb/testsuite/lib/gdb.exp