diff options
author | Pedro Alves <palves@redhat.com> | 2014-08-20 18:55:54 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2014-08-20 18:55:54 +0100 |
commit | 2a31c6236de308f7109720230e70b96c5d5b966a (patch) | |
tree | c4c1558ae44aad7c21c6a30d6f5b3b4c7ac44dec /gdb/testsuite/README | |
parent | 469a34932ae4208240e98c843b01ea1f00892137 (diff) |
Integrate PR 12649's race detector directly in the testsuite machinery
This integrates Jan Kratochvil's nice race reproducer from PR
testsuite/12649 into the testsuite infrustructure directly.
With this, one only has to do either 'make check-read1' or 'make check
READ1="1"' to preload the read1.so library into expect.
Currently only enabled for glibc/GNU systems, and if
build==host==target.
gdb/testsuite/ChangeLog:
* Makefile.in (EXTRA_RULES, CC): New variables, get from
configure.
(EXPECT): Handle READ1 being set.
(all): Depend on EXTRA_RULES.
(check-read1, expect-read1, read1.so, read1): New rules.
* README (Testsuite Parameters): Document the READ1 make variable.
(Race detection): New section.
* configure: Regenerate.
* configure.ac: If build==host==target, and running under a
GNU/glibc system, add read1 to the extra Makefile rules.
(EXTRA_RULES): AC_SUBST it.
* lib/read1.c: New file.
gdb/ChangeLog:
* Makefile.in (check-read1): New rule.
Diffstat (limited to 'gdb/testsuite/README')
-rw-r--r-- | gdb/testsuite/README | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gdb/testsuite/README b/gdb/testsuite/README index 466993d4f0..9a5059a29a 100644 --- a/gdb/testsuite/README +++ b/gdb/testsuite/README @@ -176,6 +176,47 @@ Example: If not using GNU make then the value is passed directly to runtest. If not specified, all tests are run. +READ1 + +This make (not runtest) variable is used to specify whether the +testsuite preloads the read1.so library into expect. Any non-empty +value means true. See "Race detection" below. + +Race detection +************** + +The testsuite includes a mechanism that helps detect test races. + +For example, say the program running under expect outputs "abcd", and +a test does something like this: + + expect { + "a.*c" { + } + "b" { + } + "a" { + } + } + +Which case happens to match depends on what expect manages to read +into its internal buffer in one go. If it manages to read three bytes +or more, then the first case matches. If it manages to read two +bytes, then the second case matches. If it manages to read only one +byte, then the third case matches. + +To help detect these cases, the race detection mechanism preloads a +library into expect that forces the `read' system call to always +return at most 1 byte. + +To enable this, either pass a non-empty value in the READ1 make +variable, or use the check-read1 make target instead of check. + +Examples: + + make -j10 check-read1 TESTS="*/paginate-*.exp" + make -j10 check READ1="1" + Testsuite Configuration *********************** |