krasimir added a comment. For testing you could do something similar to how clang-format does it <https://github.com/llvm-mirror/clang/blob/master/test/Format/style-on-command-line.cpp>. https://reviews.llvm.org/D39430