From 7a8317fff524a047e99569c1d26fe98fb4a0cbb9 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 14 Aug 2013 02:26:03 +0000 Subject: [PATCH] clang-tools-extra/test/cpp11-migrate/HeaderReplacements/main.cpp: Use FileCheck instead of grep(1). llvm-svn: 188347 --- .../cpp11-migrate/HeaderReplacements/main.cpp | 16 ++++++++++++---- 1 file 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 1d7adc84404e..444e4beeb6cf 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" -- 2.34.1