[clang-tools-extra] r306843 - Move ClassReplacements.cpp test from clang-rename tests to the
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 30 09:58:36 PDT 2017
Author: arphaman
Date: Fri Jun 30 09:58:36 2017
New Revision: 306843
URL: http://llvm.org/viewvc/llvm-project?rev=306843&view=rev
Log:
Move ClassReplacements.cpp test from clang-rename tests to the
clang-apply-replacements tests
The ClassReplacements.cpp test in the clang-rename tests uses
clang-apply-replacements. I moved it back to the clang-tools-extra repository
for now to ensure that the clang-rename tests can pass when clang is compiled
without clang-tools-extra.
Added:
clang-tools-extra/trunk/test/clang-apply-replacements/ClangRenameClassReplacements.cpp
Modified:
clang-tools-extra/trunk/test/CMakeLists.txt
Modified: clang-tools-extra/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/CMakeLists.txt?rev=306843&r1=306842&r2=306843&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/test/CMakeLists.txt Fri Jun 30 09:58:36 2017
@@ -36,6 +36,8 @@ set(CLANG_TOOLS_TEST_DEPS
# For the clang-tidy libclang integration test.
c-index-test
+ # For the clang-apply-replacements test that uses clang-rename.
+ clang-rename
# Individual tools we test.
clang-apply-replacements
Added: clang-tools-extra/trunk/test/clang-apply-replacements/ClangRenameClassReplacements.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-apply-replacements/ClangRenameClassReplacements.cpp?rev=306843&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-apply-replacements/ClangRenameClassReplacements.cpp (added)
+++ clang-tools-extra/trunk/test/clang-apply-replacements/ClangRenameClassReplacements.cpp Fri Jun 30 09:58:36 2017
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/fixes
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=254 -new-name=Bar -export-fixes=%t/fixes/clang-rename.yaml %t.cpp --
+// RUN: clang-apply-replacements %t
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+
+class Foo {}; // CHECK: class Bar {};
+
+// Use grep -FUbo 'Foo' <file> to get the correct offset of Cla when changing
+// this file.
More information about the cfe-commits
mailing list