[PATCH] Port test/Driver/mg.c to use FileCheck instead of fgrep

İsmail Dönmez ismail at donmez.ws
Wed Feb 4 10:20:21 PST 2015


On Wed, Feb 4, 2015 at 8:19 PM, Ben Langmuir <blangmuir at apple.com> wrote:
>
> On Feb 4, 2015, at 10:13 AM, İsmail Dönmez <ismail at donmez.ws> wrote:
>
> On Wed, Feb 4, 2015 at 7:01 PM, Ben Langmuir <blangmuir at apple.com> wrote:
>
> Index: llvm/tools/clang/test/Driver/mg.c
> ===================================================================
> --- llvm.orig/tools/clang/test/Driver/mg.c
> +++ llvm/tools/clang/test/Driver/mg.c
> @@ -1,5 +1,5 @@
> -// RUN: %clang -M -MG -include nonexistent-preinclude.h %s > %t
> -// RUN: grep -F nonexistent-preinclude.h %t
> -// RUN: grep -F nonexistent-ppinclude.h %t
> +// RUN: %clang -M -MG -include nonexistent-preinclude.h %s 2>&1 | FileCheck
> %s
> +// CHECK: nonexistent-preinclude.h
> +// CHECK: nonexistent-ppinclude.h
>
> #include "nonexistent-ppinclude.h”
>
>
>
> Is there a reason you’ve redirected stderr to stdout?  The original test
> only checked stdout and there shouldn’t be anything on stderr.
>
>
>
> Actually because thats what other FileCheck tests it in other files so
> I just copied the idea.
>
>
> Okay, I think we’re better without it because what we’re testing should all
> be on stdout.  LGTM with that change; do you need someone to commit this for
> you?

Yes, please. Attached is without stderr redirection.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fgrep.patch
Type: application/octet-stream
Size: 544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150204/a1d90a11/attachment.obj>


More information about the cfe-commits mailing list