[clang-tidy] Set current main file name in tests.
authorAlexander Kornienko <alexfh@google.com>
Mon, 27 Jul 2015 14:54:31 +0000 (14:54 +0000)
committerAlexander Kornienko <alexfh@google.com>
Mon, 27 Jul 2015 14:54:31 +0000 (14:54 +0000)
llvm-svn: 243272

clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h

index bbb33f1..1bc01d3 100644 (file)
@@ -55,6 +55,7 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr,
   T Check("test-check", &Context);
   ast_matchers::MatchFinder Finder;
   Check.registerMatchers(&Finder);
+  Context.setCurrentFile(Filename.str());
 
   std::vector<std::string> ArgCXX11(1, "clang-tidy");
   ArgCXX11.push_back("-fsyntax-only");