aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-16 14:55:28 +0000
committerManuel Klimek <klimek@google.com>2013-01-16 14:55:28 +0000
commitca547dbbb1e10c801158f2eecaf3d49e1071b0e3 (patch)
tree55b8bf41c4f5dbe1da3e27bb6892b240e3edad43 /unittests/Format/FormatTest.cpp
parent8fa37999164844a926448ef4656bbf7c42070235 (diff)
Add debugging support for split penalties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index e75d61e662..efea545d32 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -7,10 +7,16 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "format-test"
+
#include "clang/Format/Format.h"
-#include "../Tooling/RewriterTestContext.h"
#include "clang/Lex/Lexer.h"
#include "gtest/gtest.h"
+#include "llvm/Support/Debug.h"
+#include "../Tooling/RewriterTestContext.h"
+
+// Uncomment to get debug output from tests:
+// #define DEBUG_WITH_TYPE(T, X) do { X; } while(0)
namespace clang {
namespace format {
@@ -19,6 +25,7 @@ class FormatTest : public ::testing::Test {
protected:
std::string format(llvm::StringRef Code, unsigned Offset, unsigned Length,
const FormatStyle &Style) {
+ DEBUG(llvm::errs() << "---\n");
RewriterTestContext Context;
FileID ID = Context.createInMemoryFile("input.cc", Code);
SourceLocation Start =
@@ -32,6 +39,7 @@ protected:
Ranges,
new IgnoringDiagConsumer());
EXPECT_TRUE(applyAllReplacements(Replace, Context.Rewrite));
+ DEBUG(llvm::errs() << "\n" << Context.getRewrittenText(ID) << "\n\n");
return Context.getRewrittenText(ID);
}