[cfe-dev] Patch to fix 2>&1 > /dev/null tests on Windows

Baptiste Lepilleur baptiste.lepilleur at gmail.com
Thu Aug 13 05:14:13 PDT 2009


2009/8/13 Daniel Dunbar <daniel at zuster.org>

> Hi Baptiste,
>
> This patch isn't quite correct, the situation is both more complicated
> and simpler. What the script needs to do is just model the file
> mappings (which start out as the default), and then apply each
> redirection to that model. Then at the end, it needs to verify that we
> can call the subprocess module with the right settings to match the
> redirection.
>
> For now, a simpler patch which I would be fine with is to just change
> those 4 tests to use a temporary file instead of shell redirection
> fun, e.g.:
>
> RUN: clang 2> %t
> RUN: grep 'file ...' %t | count 3
>
>  - Daniel


You're right, this will work just as well. It is a lot simpler and remove
the /dev/null issue.

Can you elaborate why the patch is incorrect? From the tests I made the
stderr of clang-cc is correctly redirected to stdin of count/grep... What am
I missing?


> On Tue, Aug 11, 2009 at 3:19 PM, Baptiste
> Lepilleur<baptiste.lepilleur at gmail.com> wrote:
> > This patch fixes failures of test such as:
> > // RUN: clang-cc -E %s -fno-caret-diagnostics 2>&1 >/dev/null | grep
> 'file
> > successfully included' | count 3
> >
> > when run on Windows with the shell emulation.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090813/de02c579/attachment.html>


More information about the cfe-dev mailing list