浏览代码

BUG: After running builtin ctest, go back to the original directory

Bill Hoffman 22 年之前
父节点
当前提交
9b8ca58538
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Source/cmCTest.cxx

+ 4 - 0
Source/cmCTest.cxx

@@ -2946,7 +2946,11 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, int *re
         args.push_back(argv[i]);
         }
       }
+    std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
+    
     *retVal = inst.Run(args, output);
+    cmSystemTools::ChangeDirectory(oldpath.c_str());
+    
     if(m_Verbose)
       {
       std::cout << "Internal cmCTest object used to run test.\n";