summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-10-05 12:15:58 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-10-05 12:15:58 +0000
commitc0f00b79f79171b3595f77df8f7fa4cf16365c3b (patch)
treef6fee93270bec60820cb94dbb9aded358a444316 /clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp
parentc83946f7f522c4b45d60f3bac4849f0811e18d30 (diff)
downloadbcm5719-llvm-c0f00b79f79171b3595f77df8f7fa4cf16365c3b.tar.gz
bcm5719-llvm-c0f00b79f79171b3595f77df8f7fa4cf16365c3b.zip
clang-modernize: Apply replacements using clang-apply-replacements
Summary: The clang-apply-replacements process is now invoked to apply replacements between applying transforms. This resulted in a massive simplification of the tool: - FileOverrides class no longer needed. - Change tracking and code formatting no longer needed. - No more dependency on libclangApplyReplacements. - Final syntax check is easier to do directly now than with a separate header/source pair. Replacement handling stuff abstracted into a new header/source pair to de-clutter ClangModernize.cpp somewhat. Tests updated. Differential Revision: http://llvm-reviews.chandlerc.com/D1836 llvm-svn: 192032
Diffstat (limited to 'clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp b/clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp
index 9383ded4d98..45e8cce6e4e 100644
--- a/clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp
+++ b/clang-tools-extra/unittests/clang-modernize/UniqueHeaderNameTest.cpp
@@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===//
#include "gtest/gtest.h"
-#include "Core/FileOverrides.h"
+#include "Core/ReplacementHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Regex.h"
@@ -28,10 +28,13 @@ TEST(UniqueHeaderName, testUniqueHeaderName) {
append(SourceFile, "project/lib/feature.cpp");
native(SourceFile.str().str(), SourceFile);
+ llvm::SmallString<128> DestDir(TmpDir);
+ append(DestDir, "replacements");
+
llvm::SmallString<128> FullActualPath;
llvm::SmallString<128> Error;
- bool Result =
- generateReplacementsFileName(SourceFile, FullActualPath, Error);
+ bool Result = ReplacementHandling::generateReplacementsFileName(
+ DestDir, SourceFile, FullActualPath, Error);
ASSERT_TRUE(Result);
EXPECT_TRUE(Error.empty());
@@ -45,7 +48,7 @@ TEST(UniqueHeaderName, testUniqueHeaderName) {
llvm::SmallString<128> ActualName =
llvm::sys::path::filename(FullActualPath);
- EXPECT_STREQ(ExpectedPath.c_str(), ActualPath.c_str());
+ EXPECT_STREQ(DestDir.c_str(), ActualPath.c_str());
llvm::StringRef ExpectedName =
"^feature.cpp_[0-9a-f]{2}_[0-9a-f]{2}_[0-9a-f]{2}_[0-9a-f]{2}_["
OpenPOWER on IntegriCloud