ソースを参照

Try to fix warnings and windows test failures caused by r316653

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316661 91177308-0d34-0410-b5e6-96231b3b80d8
Eric Liu 7 年 前
コミット
8084ad7fc6
2 ファイル変更10 行追加10 行削除
  1. 1 1
      lib/Tooling/StandaloneExecution.cpp
  2. 9 9
      unittests/Tooling/ExecutionTest.cpp

+ 1 - 1
lib/Tooling/StandaloneExecution.cpp

@@ -62,7 +62,7 @@ llvm::Error StandaloneToolExecutor::execute(
   auto &Action = Actions.front();
   Tool.appendArgumentsAdjuster(Action.second);
   Tool.appendArgumentsAdjuster(ArgsAdjuster);
-  if (int Ret = Tool.run(Action.first.get()))
+  if (Tool.run(Action.first.get()))
     return make_string_error("Failed to run action.");
 
   return llvm::Error::success();

+ 9 - 9
unittests/Tooling/ExecutionTest.cpp

@@ -183,10 +183,10 @@ TEST(CreateToolExecutorTest, CreateTestToolExecutor) {
 }
 
 TEST(StandaloneToolTest, SynctaxOnlyActionOnSimpleCode) {
-  FixedCompilationDatabase Compilations("/", std::vector<std::string>());
+  FixedCompilationDatabase Compilations(".", std::vector<std::string>());
   StandaloneToolExecutor Executor(Compilations,
-                                  std::vector<std::string>(1, "/a.cc"));
-  Executor.mapVirtualFile("/a.cc", "int x = 0;");
+                                  std::vector<std::string>(1, "a.cc"));
+  Executor.mapVirtualFile("a.cc", "int x = 0;");
 
   auto Err = Executor.execute(newFrontendActionFactory<SyntaxOnlyAction>(),
                               getClangSyntaxOnlyAdjuster());
@@ -194,10 +194,10 @@ TEST(StandaloneToolTest, SynctaxOnlyActionOnSimpleCode) {
 }
 
 TEST(StandaloneToolTest, SimpleAction) {
-  FixedCompilationDatabase Compilations("/", std::vector<std::string>());
+  FixedCompilationDatabase Compilations(".", std::vector<std::string>());
   StandaloneToolExecutor Executor(Compilations,
-                                  std::vector<std::string>(1, "/a.cc"));
-  Executor.mapVirtualFile("/a.cc", "int x = 0;");
+                                  std::vector<std::string>(1, "a.cc"));
+  Executor.mapVirtualFile("a.cc", "int x = 0;");
 
   auto Err = Executor.execute(std::unique_ptr<FrontendActionFactory>(
       new ReportResultActionFactory(Executor.getExecutionContext())));
@@ -207,10 +207,10 @@ TEST(StandaloneToolTest, SimpleAction) {
 }
 
 TEST(StandaloneToolTest, SimpleActionWithResult) {
-  FixedCompilationDatabase Compilations("/", std::vector<std::string>());
+  FixedCompilationDatabase Compilations(".", std::vector<std::string>());
   StandaloneToolExecutor Executor(Compilations,
-                                  std::vector<std::string>(1, "/a.cc"));
-  Executor.mapVirtualFile("/a.cc", "int x = 0; void f() {}");
+                                  std::vector<std::string>(1, "a.cc"));
+  Executor.mapVirtualFile("a.cc", "int x = 0; void f() {}");
 
   auto Err = Executor.execute(std::unique_ptr<FrontendActionFactory>(
       new ReportResultActionFactory(Executor.getExecutionContext())));