diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-08-14 02:26:03 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-08-14 02:26:03 +0000 |
commit | 7a8317fff524a047e99569c1d26fe98fb4a0cbb9 (patch) | |
tree | 64dd470862708562de4377eb7a1dfced222cc299 | |
parent | be4a6768f1c730acb467f91544c5ec9cc9210481 (diff) | |
download | bcm5719-llvm-7a8317fff524a047e99569c1d26fe98fb4a0cbb9.tar.gz bcm5719-llvm-7a8317fff524a047e99569c1d26fe98fb4a0cbb9.zip |
clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Use FileCheck instead of grep(1).
llvm-svn: 188347
-rw-r--r-- | clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp b/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp index 1d7adc84404..444e4beeb6c 100644 --- a/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp +++ b/clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp @@ -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" |