[clang-tools-extra] r188347 - clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Use FileCheck instead of grep(1).

NAKAMURA Takumi geek4civic at gmail.com
Tue Aug 13 19:26:03 PDT 2013


Author: chapuni
Date: Tue Aug 13 21:26:03 2013
New Revision: 188347

URL: http://llvm.org/viewvc/llvm-project?rev=188347&view=rev
Log:
clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Use FileCheck instead of grep(1).

Modified:
    clang-tools-extra/trunk/test/cpp11-migrate/HeaderReplacements/main.cpp

Modified: clang-tools-extra/trunk/test/cpp11-migrate/HeaderReplacements/main.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/cpp11-migrate/HeaderReplacements/main.cpp?rev=188347&r1=188346&r2=188347&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/cpp11-migrate/HeaderReplacements/main.cpp (original)
+++ clang-tools-extra/trunk/test/cpp11-migrate/HeaderReplacements/main.cpp Tue Aug 13 21:26:03 2013
@@ -6,8 +6,8 @@
 // RUN: cp %S/main.cpp %S/common.cpp %S/common.h %t/Test
 // RUN: cpp11-migrate -loop-convert -headers -include=%t/Test %t/Test/main.cpp %t/Test/common.cpp --
 // Check that only 1 file is generated per translation unit and header file.
-// RUN: ls -1 %t/Test | grep -c "main.cpp_common.h_.*.yaml" | grep "^1$"
-// RUN: ls -1 %t/Test | grep -c "common.cpp_common.h_.*.yaml" | grep "^1$"
+// RUN: ls -1 %t/Test | FileCheck %s --check-prefix=MAIN_CPP
+// RUN: ls -1 %t/Test | FileCheck %s --check-prefix=COMMON_CPP
 // RUN: cp %S/common.h.yaml %t/Test/main.cpp_common.h.yaml
 // We need to put the build path to the expected YAML file to diff against the generated one.
 // RUN: sed -e 's#$(path)#%t/Test#g' %S/common.h.yaml > %t/Test/main.cpp_common.h.yaml
@@ -25,12 +25,20 @@
 // RUN: cpp11-migrate -loop-convert -headers -include=%t/Test %t/Test/main.cpp --
 // RUN: cpp11-migrate -loop-convert %t/Test/common.cpp --
 // Check that only one YAML file is generated from main.cpp and common.h and not from common.cpp and common.h since -header is not specified
-// RUN: ls -1 %t/Test | grep -c "main.cpp_common.h_.*.yaml" | grep "^1$"
-// RUN: ls -1 %t/Test | not grep "common.cpp_common.h_.*.yaml"
+// RUN: ls -1 %t/Test | FileCheck %s --check-prefix=MAIN_CPP
+// RUN: ls -1 %t/Test | FileCheck %s --check-prefix=NO_COMMON
 // We need to put the build path to the expected YAML file to diff against the generated one.
 // RUN: sed -e 's#$(path)#%t/Test#g' %S/common.h.yaml > %t/Test/main.cpp_common.h.yaml
 // RUN: sed -i -e 's#\\#/#g' %t/Test/main.cpp_common.h_*.yaml
 // RUN: diff -b %t/Test/main.cpp_common.h.yaml %t/Test/main.cpp_common.h_*.yaml
+//
+// MAIN_CPP: {{^main.cpp_common.h_.*.yaml$}}
+// MAIN_CPP-NOT: {{main.cpp_common.h_.*.yaml}}
+//
+// COMMON_CPP:     {{^common.cpp_common.h_.*.yaml$}}
+// COMMON_CPP-NOT: {{common.cpp_common.h_.*.yaml}}
+//
+// NO_COMMON-NOT: {{common.cpp_common.h_.*.yaml}}
 
 #include "common.h"
 





More information about the cfe-commits mailing list