[cfe-commits] [PATCH] Simplifying lit script for remove-cstr-calls

Manuel Klimek klimek at google.com
Thu Nov 1 06:55:00 PDT 2012


On Wed, Oct 31, 2012 at 12:10 PM, Vane, Edwin <edwin.vane at intel.com> wrote:

> From: Matthieu Monrocq [mailto:matthieu.monrocq at gmail.com]
> Sent: Wednesday, October 31, 2012 2:17 PM
> To: reviews+D92+public+254f3887f2e36b94 at llvm-reviews.chandlerc.com
> Cc: chandlerc at gmail.com; Vane, Edwin; Clang Dev List
> Subject: Re: [cfe-commits] [PATCH] Simplifying lit script for
> remove-cstr-calls
>
>
> On Wed, Oct 31, 2012 at 4:28 PM, Edwin Vane <edwin.vane at intel.com> wrote:
> Hi chandlerc,
>
> Following the example from loop-convert tests, simplifying the
> remove-cstr-calls lit script.
>
> http://llvm-reviews.chandlerc.com/D92
>
> Files:
>   test/remove-cstr-calls/basic.cpp
>
> Index: test/remove-cstr-calls/basic.cpp
> ===================================================================
> --- test/remove-cstr-calls/basic.cpp
> +++ test/remove-cstr-calls/basic.cpp
> @@ -1,12 +1,7 @@
> -// RUN: rm -rf %t
> -// RUN: mkdir %t
> -// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c
> %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\//g' >
> %t/compile_commands.json
> -// RUN: cp "%s" "%t/test.cpp"
> -// RUN: remove-cstr-calls "%t" "%t/test.cpp"
> -// RUN: cat "%t/test.cpp" | FileCheck %s
> +// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
> +// RUN: remove-cstr-calls . %t.cpp --
> +// RUN: FileCheck -input-file=%t.cpp %s
>
> FileCheck can accept arguments on the standard input (and thus it's
> possible to pipe into it)
>
> Would it be simpler to have remove-cstr-calls emit output on the standard
> output and just pipe it into FileCheck ?
>
> REV: The refactoring framework doesn't output to stdout but rewrites files
> in place. So it would definitely be less simple to add that feature to the
> refactoring tool.
>

Yep. Rewriting a single file is actually just a narrow special case.


>
> -- Matthieu
>
>  // REQUIRES: shell
> -// FIXME: implement a mode for refactoring tools that takes input from
> stdin
> -// and writes output to stdout for easier testing of tools.
>
>  namespace std {
>  template<typename T> class allocator {};
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121101/e3582f01/attachment.html>


More information about the cfe-commits mailing list