On Wed, Mar 23, 2016 at 04:56:36PM +0800, Zhou Wenjian wrote: > * tests/option_d_r.c: New file. > * tests/option_d_r.expected: New file. > * tests/option_d_r.test: New test. > * tests/.gitignore: Add option_d_r. > * tests/Makefile.am (check_PROGRAMS): Likewise. > (TESTS): Add option_d_r.test.
Well, what can I say? This patch is so spectacularly wrong
in various aspects that I hardly can do it justice.
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -151,3 +151,4 @@ xetitimer
> xetpgid
> xetpriority
> xettimeofday
> +option_d_r
An element is added at the end of the sorted list.
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -199,6 +199,7 @@ check_PROGRAMS = \
> xetpgid \
> xetpriority \
> xettimeofday \
> + option_d_r \
> # end of check_PROGRAMS
An element is added at the end of the sorted list.
> @@ -378,6 +379,7 @@ TESTS = \
> opipe.test \
> redirect.test \
> restart_syscall.test \
> + option_d_r.test \
> $(LIBUNWIND_TESTS)
An element is added at the end of the sorted list.
> +int
> +main()
> +{
> + int pid = fork();
> + assert(pid != -1);
Inconsistent indentation.
> + return 0;
> +}
> +
Trailing whitespace.
> --- /dev/null
> +++ b/tests/option_d_r.expected
> @@ -0,0 +1,6 @@
> +.*/strace: new tcb for pid [0-9]*, active tcbs:1
> +.*/strace: pid [0-9]* has TCB_STARTUP, initializing it
> +.*/strace: new tcb for pid [0-9]*, active tcbs:2
> +.*/strace: dropped tcb for pid [0-9]*, 1 remain
> +.*/strace: dropped tcb for pid [0-9]*, 0 remain
> +^.*0.[0-9] execve.*
Two completely unrelated options -d and -r are tested together.
-d enables debug output which is not a part of any API and therefore
can change (and sometimes changes) without notice, so hardly worth a test.
Does it test whether the output produced by -r option makes any sense?
No, it doesn't.
Compare with tests/strace-r.expected that does a strict check.
--
ldv
pgpdW9XLyFrOi.pgp
Description: PGP signature
------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
