From 9f1d9fd1964d82f3e801efb71518144492cdf290 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Jun 2013 20:58:35 +0000 Subject: Remove the program class. It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183864 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/ProgramTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'unittests/Support/ProgramTest.cpp') diff --git a/unittests/Support/ProgramTest.cpp b/unittests/Support/ProgramTest.cpp index 6cbb054..f132c03 100644 --- a/unittests/Support/ProgramTest.cpp +++ b/unittests/Support/ProgramTest.cpp @@ -79,9 +79,9 @@ TEST(ProgramTest, CreateProcessTrailingSlash) { Path nul("/dev/null"); #endif const Path *redirects[] = { &nul, &nul, 0 }; - int rc = Program::ExecuteAndWait(my_exe, argv, &envp[0], redirects, - /*secondsToWait=*/10, /*memoryLimit=*/0, - &error, &ExecutionFailed); + int rc = + ExecuteAndWait(my_exe, argv, &envp[0], redirects, /*secondsToWait=*/ 10, + /*memoryLimit=*/ 0, &error, &ExecutionFailed); EXPECT_FALSE(ExecutionFailed) << error; EXPECT_EQ(0, rc); } -- cgit v1.1 From 675e0ac0bfd6fb78423d9fbee9f50c1dec62c111 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 13 Jun 2013 20:25:38 +0000 Subject: Avoid using PathV1.h in Program.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/ProgramTest.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'unittests/Support/ProgramTest.cpp') diff --git a/unittests/Support/ProgramTest.cpp b/unittests/Support/ProgramTest.cpp index f132c03..1cf53d5 100644 --- a/unittests/Support/ProgramTest.cpp +++ b/unittests/Support/ProgramTest.cpp @@ -9,6 +9,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Path.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/Program.h" #include "gtest/gtest.h" @@ -74,14 +75,14 @@ TEST(ProgramTest, CreateProcessTrailingSlash) { bool ExecutionFailed; // Redirect stdout and stdin to NUL, but let stderr through. #ifdef LLVM_ON_WIN32 - Path nul("NUL"); + StringRef nul("NUL"); #else - Path nul("/dev/null"); + StringRef nul("/dev/null"); #endif - const Path *redirects[] = { &nul, &nul, 0 }; - int rc = - ExecuteAndWait(my_exe, argv, &envp[0], redirects, /*secondsToWait=*/ 10, - /*memoryLimit=*/ 0, &error, &ExecutionFailed); + const StringRef *redirects[] = { &nul, &nul, 0 }; + int rc = ExecuteAndWait(my_exe.str(), argv, &envp[0], redirects, + /*secondsToWait=*/ 10, /*memoryLimit=*/ 0, &error, + &ExecutionFailed); EXPECT_FALSE(ExecutionFailed) << error; EXPECT_EQ(0, rc); } -- cgit v1.1 From 50188c1f42c122640ab9ccac2134acf371c26b2c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 26 Jun 2013 05:01:35 +0000 Subject: Port GetMainExecutable over to PathV2. I will remove the V1 version as soon as I change clang in the next commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184914 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/ProgramTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'unittests/Support/ProgramTest.cpp') diff --git a/unittests/Support/ProgramTest.cpp b/unittests/Support/ProgramTest.cpp index 1cf53d5..7886761 100644 --- a/unittests/Support/ProgramTest.cpp +++ b/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; -- cgit v1.1 From df0f525cc49511cf9dca82d77b93675bcaf5103c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 26 Jun 2013 13:54:34 +0000 Subject: Remove unused includes. llvm itself is now PathV1 clean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184947 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/ProgramTest.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'unittests/Support/ProgramTest.cpp') diff --git a/unittests/Support/ProgramTest.cpp b/unittests/Support/ProgramTest.cpp index 7886761..6852ca6 100644 --- a/unittests/Support/ProgramTest.cpp +++ b/unittests/Support/ProgramTest.cpp @@ -10,7 +10,6 @@ #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" #include "gtest/gtest.h" -- cgit v1.1