summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/ProgramTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-26 05:01:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-26 05:01:35 +0000
commite03dfd9b0a176d1f7cb0c662263a13a9c7c30b7e (patch)
treeb9b09feb60cd9fd96dd75a6638a04192cdf77f2f /llvm/unittests/Support/ProgramTest.cpp
parent399ab33a37ab0cf08c0e35052820ea2b7e1d2e24 (diff)
downloadbcm5719-llvm-e03dfd9b0a176d1f7cb0c662263a13a9c7c30b7e.tar.gz
bcm5719-llvm-e03dfd9b0a176d1f7cb0c662263a13a9c7c30b7e.zip
Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit. llvm-svn: 184914
Diffstat (limited to 'llvm/unittests/Support/ProgramTest.cpp')
-rw-r--r--llvm/unittests/Support/ProgramTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/unittests/Support/ProgramTest.cpp b/llvm/unittests/Support/ProgramTest.cpp
index 1cf53d50b02..7886761c9aa 100644
--- a/llvm/unittests/Support/ProgramTest.cpp
+++ b/llvm/unittests/Support/ProgramTest.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/PathV1.h"
#include "llvm/Support/Program.h"
@@ -56,7 +57,8 @@ TEST(ProgramTest, CreateProcessTrailingSlash) {
exit(1);
}
- Path my_exe = Path::GetMainExecutable(TestMainArgv0, &ProgramTestStringArg1);
+ std::string my_exe =
+ sys::fs::getMainExecutable(TestMainArgv0, &ProgramTestStringArg1);
const char *argv[] = {
my_exe.c_str(),
"--gtest_filter=ProgramTest.CreateProcessTrailingSlashChild",
@@ -80,7 +82,7 @@ TEST(ProgramTest, CreateProcessTrailingSlash) {
StringRef nul("/dev/null");
#endif
const StringRef *redirects[] = { &nul, &nul, 0 };
- int rc = ExecuteAndWait(my_exe.str(), argv, &envp[0], redirects,
+ int rc = ExecuteAndWait(my_exe, argv, &envp[0], redirects,
/*secondsToWait=*/ 10, /*memoryLimit=*/ 0, &error,
&ExecutionFailed);
EXPECT_FALSE(ExecutionFailed) << error;
OpenPOWER on IntegriCloud