ioeric added inline comments. ================ Comment at: unittests/Format/CleanupTest.cpp:310 @@ +309,3 @@ + + Context.createInMemoryFile("fix.cpp", Code); + tooling::Replacements Replaces; ---------------- djasper wrote: > I'd pull out a lot of these environment setup things into abstractions in the > test fixture. Maybe all you need is two functions like: > > insert(Code, Replaces); > > and > > insertAndFormat(Code, Replaces); > > ? I had tried to pull out the environment setup...but it didn't seem to save much code without sacrificing flexibility.
In some test cases, we also need to add replacements other than header insertions, and those replacements construction uses `FileID`, so `createInMemoryFile` needs to stay in test functions. `FormatStyle` differs among test cases, so it has to stay. All we save might just be the two lines which could be either cleanup or cleanup+format.\ Any better ideas? http://reviews.llvm.org/D20734 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits