<div dir="ltr">What's strange is that I copied this pattern from clang-tidy-run-with-database.cpp, and I'm not sure why it would work there and not here..<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 17, 2017 at 8:16 PM, Ehsan Akhgari <span dir="ltr"><<a href="mailto:ehsan.akhgari@gmail.com" target="_blank">ehsan.akhgari@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Douglas,<br><br></div>Sorry about this.  It seems to me that the reason for this test failure is the slashes that appear in the -path argument in the log:<br><br><pre><span class="m_3396670536006699994gmail-stdout">"-path" "C:\Buildbot\Slave\llvm-clang-<wbr>lld-x86_64-scei-ps4-<wbr>windows10pro-fast\llvm.obj\<wbr>tools\clang\tools\extra\test\<wbr>clang-tidy\Output/compilation-<wbr>database-test"
$ "FileCheck" "-check-prefix=CHECK" "C:\Buildbot\Slave\llvm-clang-<wbr>lld-x86_64-scei-ps4-<wbr>windows10pro-fast\llvm.src\<wbr>tools\clang\tools\extra\test\<wbr>clang-tidy\clang-tidy-diff.<wbr>cpp"<br><br></span></pre><pre><span class="m_3396670536006699994gmail-stdout"><span style="font-family:arial,helvetica,sans-serif">However I'm not sure how to fix this.  I'm using slashes as the path separator in the test RUN command.  Is there a safer platform independent token I should use instead?</span><br></span></pre></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Feb 17, 2017 at 3:57 PM, Yung, Douglas <span dir="ltr"><<a href="mailto:douglas.yung@sony.com" target="_blank">douglas.yung@sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ehsan,<br>
<br>
Your commit has caused the PS4 Windows bot to go red. Can you take a look?<br>
<br>
<a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5661" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/build<wbr>ers/llvm-clang-lld-x86_64-<wbr>scei-ps4-windows10pro-fast/bui<wbr>lds/5661</a><br>
<br>
$ "FileCheck" "-check-prefix=CHECK" "C:\Buildbot\Slave\llvm-clang-<wbr>lld-x86_64-scei-ps4-windows10p<wbr>ro-fast\llvm.src\tools\clang\<wbr>tools\extra\test\clang-tidy\<wbr>clang-tidy-diff.cpp"<br>
# command stderr:<br>
C:\Buildbot\Slave\llvm-clang-l<wbr>ld-x86_64-scei-ps4-windows10pr<wbr>o-fast\llvm.src\tools\clang\<wbr>tools\extra\test\clang-tidy\<wbr>clang-tidy-diff.cpp:17:11: error: expected string not found in input<br>
<br>
// CHECK: [[@LINE-2]]:8: warning: annotate this<br>
<br>
          ^<br>
<br>
<stdin>:1:1: note: scanning from here<br>
<br>
YAML:1:1: error: Unrecognized escape code!<br>
<br>
^<br>
<br>
<stdin>:1:1: note: with expression "@LINE-2" equal to "15"<br>
<br>
YAML:1:1: error: Unrecognized escape code!<br>
<br>
^<br>
<br>
<stdin>:1:7: note: possible intended match here<br>
<br>
YAML:1:1: error: Unrecognized escape code!<br>
<br>
      ^<br>
<br>
<br>
error: command failed with exit status: 1<br>
<br>
Douglas Yung<br>
<br>
> -----Original Message-----<br>
> From: cfe-commits [mailto:<a href="mailto:cfe-commits-bounces@lists.llvm.org" target="_blank">cfe-commits-bounces@li<wbr>sts.llvm.org</a>] On Behalf Of<br>
> Ehsan Akhgari via cfe-commits<br>
> Sent: Friday, February 17, 2017 11:32<br>
> To: <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
> Subject: [clang-tools-extra] r295482 - [clang-tidy] Add -path option to clang-<br>
> tidy-diff.py<br>
><br>
> Author: ehsan<br>
> Date: Fri Feb 17 13:31:43 2017<br>
> New Revision: 295482<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=295482&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=295482&view=rev</a><br>
> Log:<br>
> [clang-tidy] Add -path option to clang-tidy-diff.py<br>
><br>
> Summary:<br>
> This flag allows specifying a custom path for the compilation database.<br>
> Unfortunately we can't use the -p flag like other clang-tidy tools because<br>
> it's already taken.<br>
><br>
> Reviewers: alexfh<br>
><br>
> Subscribers: JDevlieghere, cfe-commits<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D29806" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2980<wbr>6</a><br>
><br>
> Modified:<br>
>     clang-tools-extra/trunk/<wbr>clang-tidy/tool/clang-tidy-<wbr>diff.py<br>
>     clang-tools-extra/trunk/test/<wbr>clang-tidy/clang-tidy-diff.cpp<br>
><br>
> Modified: clang-tools-extra/trunk/clang-<wbr>tidy/tool/clang-tidy-diff.py<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/clang-tools-extra/trunk/<wbr>clang-</a><br>
> tidy/tool/clang-tidy-diff.py?r<wbr>ev=295482&r1=295481&r2=295482&<wbr>view=diff<br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- clang-tools-extra/trunk/clang-<wbr>tidy/tool/clang-tidy-diff.py (original)<br>
> +++ clang-tools-extra/trunk/clang-<wbr>tidy/tool/clang-tidy-diff.py Fri Feb<br>
> +++ 17 13:31:43 2017<br>
> @@ -55,6 +55,8 @@ def main():<br>
>                        help='checks filter, when not specified, use clang-tidy<br>
> '<br>
>                        'default',<br>
>                        default='')<br>
> +  parser.add_argument('-path', dest='build_path',<br>
> +                      help='Path used to read a compile command<br>
> + database.')<br>
>    parser.add_argument('-extra-ar<wbr>g', dest='extra_arg',<br>
>                        action='append', default=[],<br>
>                        help='Additional argument to append to the compiler '<br>
> @@ -124,6 +126,8 @@ def main():<br>
>      command.append('-checks=' + quote + args.checks + quote)<br>
>    if args.quiet:<br>
>      command.append('-quiet')<br>
> +  if args.build_path is not None:<br>
> +    command.append('-p=%s' % args.build_path)<br>
>    command.extend(lines_by_file.k<wbr>eys())<br>
>    for arg in args.extra_arg:<br>
>        command.append('-extra-arg=%s' % arg)<br>
><br>
> Modified: clang-tools-extra/trunk/test/c<wbr>lang-tidy/clang-tidy-diff.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/clang-tools-extra/trunk/<wbr>test/clang-</a><br>
> tidy/clang-tidy-diff.cpp?rev=2<wbr>95482&r1=295481&r2=295482&view<wbr>=diff<br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- clang-tools-extra/trunk/test/c<wbr>lang-tidy/clang-tidy-diff.cpp (original)<br>
> +++ clang-tools-extra/trunk/test/c<wbr>lang-tidy/clang-tidy-diff.cpp Fri Feb<br>
> +++ 17 13:31:43 2017<br>
> @@ -2,6 +2,9 @@<br>
>  // RUN: clang-tidy -checks=-*,modernize-use-overr<wbr>ide %t.cpp -- -std=c++11 |<br>
> FileCheck -check-prefix=CHECK-SANITY %s  // RUN: not diff -U0 %s %t.cpp |<br>
> %clang_tidy_diff -checks=-*,modernize-use-overr<wbr>ide -- -std=c++11 2>&1 |<br>
> FileCheck %s  // RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-<br>
> *,modernize-use-override -quiet -- -std=c++11 2>&1 | FileCheck -check-<br>
> prefix=CHECK-QUIET %s<br>
> +// RUN: mkdir -p %T/compilation-database-test/ // RUN: echo<br>
> +'[{"directory": "%T", "command": "clang++ -o test.o -std=c++11 %t.cpp",<br>
> +"file": "%t.cpp"}]' ><br>
> +%T/compilation-database-test/<wbr>compile_commands.json<br>
> +// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff<br>
> +-checks=-*,modernize-use-over<wbr>ride -path %T/compilation-database-test<br>
> +2>&1 | FileCheck -check-prefix=CHECK %s<br>
>  struct A {<br>
>    virtual void f() {}<br>
>    virtual void g() {}<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_3396670536006699994gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Ehsan<br></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Ehsan<br></div></div>
</div>