aboutsummaryrefslogtreecommitdiff
path: root/unittests/Tooling/TestVisitor.h
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Tooling/TestVisitor.h')
-rw-r--r--unittests/Tooling/TestVisitor.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/unittests/Tooling/TestVisitor.h b/unittests/Tooling/TestVisitor.h
index 44ae63a8f5..8333c24a68 100644
--- a/unittests/Tooling/TestVisitor.h
+++ b/unittests/Tooling/TestVisitor.h
@@ -44,9 +44,12 @@ public:
/// \brief Runs the current AST visitor over the given code.
bool runOver(StringRef Code, Language L = Lang_CXX) {
- // FIXME: The input language is determined based on the provided filename.
- static const StringRef Filenames[] = { "input.c", "input.cc" };
- return tooling::runToolOnCode(CreateTestAction(), Code, Filenames[L]);
+ std::vector<std::string> Args;
+ switch (L) {
+ case Lang_C: Args.push_back("-std=c99"); break;
+ case Lang_CXX: Args.push_back("-std=c++98"); break;
+ }
+ return tooling::runToolOnCodeWithArgs(CreateTestAction(), Code, Args);
}
bool shouldVisitTemplateInstantiations() const {