strace/test
Denys Vlasenko 000b601439 Fix a case of broken output if last seen syscall was exit
* defs.h: Rename tcp_last to printing_tcp. Explain what it means.
Remove printtrailer() function.
* process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL".
* strace.c: Add new variable printing_tcp.
(cleanup): Convert printtrailer() call to "printing_tcp = NULL".
(trace): Likewise.
(trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit.
(printleader): Set printing_tcp.
(printtrailer): Remove this function.
* syscall.c: Remove tcp_last variable.
(trace_syscall_entering): Don't set printing_tcp, printleader call now does it.
(trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL".

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-28 01:25:03 +01:00
..
.gitignore Add new test program: test/threaded_execve.c 2012-01-27 15:37:13 +01:00
childthread.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
clone.c Update test/* directory, it seem to be a bit bit-rotted 2011-06-08 14:08:59 +02:00
fork.c By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com): 2009-02-25 14:24:02 +00:00
leaderkill.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
Makefile Add new test program: test/threaded_execve.c 2012-01-27 15:37:13 +01:00
mmap_offset_decode.c Optimize sys_old_mmap 2011-08-23 12:53:01 +02:00
procpollable.c Improve code readability by avoiding assignments inside if() 2011-08-23 12:53:01 +02:00
README Update test/* directory, it seem to be a bit bit-rotted 2011-06-08 14:08:59 +02:00
sfd.c Improve code readability by avoiding assignments inside if() 2011-08-23 12:53:01 +02:00
sig.c By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com): 2009-02-25 14:24:02 +00:00
sigkill_rain.c Add fflush after printf in test/sigkill_rain.c 2011-06-08 16:07:03 +02:00
skodic.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
threaded_execve.c Fix a case of broken output if last seen syscall was exit 2012-01-28 01:25:03 +01:00
vfork.c By Hans-Christian Egtvedt (hans-christian.egtvedt AT atmel.com): 2009-02-25 14:24:02 +00:00
wait_must_be_interruptible.c Update test/* directory, it seem to be a bit bit-rotted 2011-06-08 14:08:59 +02:00

To run a test:
* Run make
* Run resulting executable(s) under strace
* Check strace output and/or program's output and exitcode

To add a new test:
* Add its .c source to this dir
* Add it to "all" and "clean" targets in Makefile
* Add it to .gitignore file

Please spend some time making your testcase understandable.
For example, it may print an explanation how it should be used
(which strace options to use, and what to look for in strace output).

If possible, make it so that your testcase detects error/bug
it is intended to test for, and prints error message and exits with 1
if the bug is detected, instead of relying on user to peruse strace output.