summaryrefslogtreecommitdiff
path: root/unittests/Tooling
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-03-02 23:37:26 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-03-02 23:37:26 +0000
commitbb8c08a065e3512fdd8d42d18571352359b87e74 (patch)
tree609c50c7f162307573c568e521fe721419a6cc56 /unittests/Tooling
parent747909cad22ba9c2b3b3a4a8a08f78633a4238e6 (diff)
downloadclang-bb8c08a065e3512fdd8d42d18571352359b87e74.tar.gz
clang-bb8c08a065e3512fdd8d42d18571352359b87e74.tar.bz2
clang-bb8c08a065e3512fdd8d42d18571352359b87e74.tar.xz
Disable all dependency output options when using the Tooling library.
It isn't appropriate for a tool to be stomping over the dependency files, especially if the actual build uses a compiler other than Clang or the tool cannot find all the headers for some reason (which would cause the existing dependency file to be deleted). If a tool actually needs to care about dependency files we can think about adding a mechanism for getting to this information. Differential Revision: http://llvm-reviews.chandlerc.com/D2912 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Tooling')
-rw-r--r--unittests/Tooling/ToolingTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/unittests/Tooling/ToolingTest.cpp b/unittests/Tooling/ToolingTest.cpp
index a75710e86c..f34fab0fc7 100644
--- a/unittests/Tooling/ToolingTest.cpp
+++ b/unittests/Tooling/ToolingTest.cpp
@@ -236,6 +236,17 @@ TEST(runToolOnCode, TestSkipFunctionBody) {
"int skipMeNot() { an_error_here }"));
}
+TEST(runToolOnCodeWithArgs, TestNoDepFile) {
+ llvm::SmallString<32> DepFilePath;
+ ASSERT_FALSE(
+ llvm::sys::fs::createTemporaryFile("depfile", "d", DepFilePath));
+ EXPECT_TRUE(runToolOnCodeWithArgs(
+ new SkipBodyAction, "",
+ { "-MMD", "-MT", DepFilePath.str(), "-MF", DepFilePath.str() }));
+ EXPECT_FALSE(llvm::sys::fs::exists(DepFilePath.str()));
+ EXPECT_FALSE(llvm::sys::fs::remove(DepFilePath.str()));
+}
+
struct CheckSyntaxOnlyAdjuster: public ArgumentsAdjuster {
bool &Found;
bool &Ran;