[clang-rename] merge tests when possible
The only difference between some tests is -offset passed to clang-rename. It
makes sense to merge them into a single file and add multiple tool invocations.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D23158
llvm-svn: 278221
diff --git a/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp b/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp
index 72710d0..086f557 100644
--- a/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp
+++ b/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp
@@ -1,13 +1,14 @@
-// RUN: cat %s > %t.cpp
-// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i --
-// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class Foo /* Test 1 */ { // CHECK: class Bar /* Test 1 */ {
+public:
+ void foo(int x);
+};
-class Foo {}; // CHECK: class Bar
+void Foo::foo(int x) /* Test 2 */ {} // CHECK: void Bar::foo(int x) /* Test 2 */ {}
-int main() {
- Foo *Pointer = 0; // CHECK: Bar *Pointer = 0;
- return 0;
-}
+// Test 1.
+// RUN: clang-rename -offset=6 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 2.
+// RUN: clang-rename -offset=109 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Use grep -FUbo 'Foo' <file> to get the correct offset of Cla when changing
-// this file.
+// To find offsets after modifying the file, use:
+// grep -Ubo 'Foo.*' <file>