diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-16 14:55:28 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-16 14:55:28 +0000 |
commit | 249981040b9f01e6557b977d94f63e504361dac5 (patch) | |
tree | cec57ad11cb679827487103141073da2ab765787 /clang/unittests/Format/FormatTest.cpp | |
parent | 2338264ad970cce047356959899668f5978afe78 (diff) | |
download | bcm5719-llvm-249981040b9f01e6557b977d94f63e504361dac5.tar.gz bcm5719-llvm-249981040b9f01e6557b977d94f63e504361dac5.zip |
Add debugging support for split penalties.
llvm-svn: 172616
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index e75d61e662b..efea545d320 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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); } |