bool runToolOnCode(clang::FrontendAction *ToolAction, const Twine &Code, const Twine &FileName, std::shared_ptr<PCHContainerOperations> PCHContainerOps) { return runToolOnCodeWithArgs(ToolAction, Code, std::vector<std::string>(), FileName, "clang-tool", std::move(PCHContainerOps)); }
TEST(runToolOnCodeWithArgs, TestNoDepFile) { llvm::SmallString<32> DepFilePath; ASSERT_FALSE( llvm::sys::fs::createTemporaryFile("depfile", "d", DepFilePath)); std::vector<std::string> Args; Args.push_back("-MMD"); Args.push_back("-MT"); Args.push_back(DepFilePath.str()); Args.push_back("-MF"); Args.push_back(DepFilePath.str()); EXPECT_TRUE(runToolOnCodeWithArgs(new SkipBodyAction, "", Args)); EXPECT_FALSE(llvm::sys::fs::exists(DepFilePath.str())); EXPECT_FALSE(llvm::sys::fs::remove(DepFilePath.str())); }
bool runToolOnCode(clang::FrontendAction *ToolAction, const Twine &Code, const Twine &FileName) { return runToolOnCodeWithArgs( ToolAction, Code, std::vector<std::string>(), FileName); }