Skip to content

Commit 6718a3b

Browse files
committed
Revert "Add a missing reference on a std::vector<> out param"
Revert "[Support] Propagate the environment into the test child process" This reverts commit r180046. This reverts commit r180041. These have broken buildbots for ~3 hours: http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/763 llvm-svn: 180066
1 parent 4a83816 commit 6718a3b

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

llvm/unittests/Support/ProgramTest.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ ProgramTestStringArg1("program-test-string-arg1");
2424
static cl::opt<std::string>
2525
ProgramTestStringArg2("program-test-string-arg2");
2626

27-
static void CopyEnvironment(std::vector<const char *> &out) {
28-
// environ appears to be pretty portable.
29-
char **envp = environ;
30-
while (*envp != 0) {
31-
out.push_back(*envp);
32-
++envp;
33-
}
34-
}
35-
3627
TEST(ProgramTest, CreateProcessTrailingSlash) {
3728
if (getenv("LLVM_PROGRAM_TEST_CHILD")) {
3829
if (ProgramTestStringArg1 == "has\\\\ trailing\\" &&
@@ -52,13 +43,7 @@ TEST(ProgramTest, CreateProcessTrailingSlash) {
5243
"-program-test-string-arg2", "has\\\\ trailing\\",
5344
0
5445
};
55-
56-
// Add LLVM_PROGRAM_TEST_CHILD to the environment of the child.
57-
std::vector<const char *> envp;
58-
CopyEnvironment(envp);
59-
envp.push_back("LLVM_PROGRAM_TEST_CHILD=1");
60-
envp.push_back(0);
61-
46+
const char *envp[] = { "LLVM_PROGRAM_TEST_CHILD=1", 0 };
6247
std::string error;
6348
bool ExecutionFailed;
6449
// Redirect stdout and stdin to NUL, but let stderr through.
@@ -68,7 +53,7 @@ TEST(ProgramTest, CreateProcessTrailingSlash) {
6853
Path nul("/dev/null");
6954
#endif
7055
const Path *redirects[] = { &nul, &nul, 0 };
71-
int rc = Program::ExecuteAndWait(my_exe, argv, &envp[0], redirects,
56+
int rc = Program::ExecuteAndWait(my_exe, argv, envp, redirects,
7257
/*secondsToWait=*/10, /*memoryLimit=*/0,
7358
&error, &ExecutionFailed);
7459
EXPECT_FALSE(ExecutionFailed) << error;

0 commit comments

Comments
 (0)