[PATCH] Write errors to stdout and not stderr in wcsmbs/tst-mbrtowc.c
Siddhesh Poyarekar
siddhesh@redhat.com
Mon Oct 6 08:54:00 GMT 2014
On Mon, Oct 06, 2014 at 09:33:33AM +0100, Will Newton wrote:
> On 3 October 2014 20:36, Roland McGrath <roland@hack.frob.com> wrote:
> > The dup2 hack is either cute or horrible (likely both). I don't think we
> > should do anything like that in one random test. Rather, we should settle
> > on a uniform policy for tests and using assert. It could be that we never
> > use assert. Or it could be that we use assert freely and just make
> > test-skeleton.c always do the dup2 hack itself. Or it could be something
> > else I haven't thought of off hand. But let's get a plan.
>
> One option could be to use a hand-rolled assert function which is what
> most unit testing libraries do. This would also give scope for adding
> more esoteric asserts that can output more detail about the failure.
Agreed, but to be clear, the hand-rolled assert should always exit
normally, i.e. not with an abort. An abort precludes any cleanups
that may be necessary for a test. In fact asserts that result in such
abnormal termination should be actively discouraged.
On whether we should redirect stderr to stdout, I am not very excited
about it. I don't want to exclude the possibility of wanting to use
stderr some time in future for the tests.
Siddhesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20141006/d98a2b01/attachment.sig>
More information about the Libc-alpha
mailing list