aboutsummaryrefslogtreecommitdiff
path: root/tests/process/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-21 00:23:19 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-21 13:21:52 +0300
commitdf2c5fcf20189750119a94ca8b91f92f5d65d758 (patch)
treead4e2c113e07dbe1c5c5eed2fac3f48ea7e487dc /tests/process/driver.cxx
parent811d4229c196c1c98ff865fdfd981ef2908f6d8b (diff)
Add support for passing environment variables to child process on Windows
Diffstat (limited to 'tests/process/driver.cxx')
-rw-r--r--tests/process/driver.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/process/driver.cxx b/tests/process/driver.cxx
index 8e0ad36..0338af2 100644
--- a/tests/process/driver.cxx
+++ b/tests/process/driver.cxx
@@ -51,14 +51,12 @@ exec (const path& p,
// sure that the child process will not see the variable that is requested
// to be unset, and will see the other one unaffected.
//
- // Note that we don't support (un)setting environment variables for the
- // child process on Windows.
- //
#ifndef _WIN32
assert (setenv ("DEF", "2", 1) == 0);
assert (setenv ("XYZ", "3", 1) == 0);
#else
- assert (false);
+ assert (_putenv ("DEF=2") == 0);
+ assert (_putenv ("XYZ=3") == 0);
#endif
}
@@ -328,12 +326,7 @@ main (int argc, const char* argv[])
// Passing environment variables to the child process.
//
- // Note that we don't support (un)setting environment variables for the
- // child process on Windows.
- //
-#ifndef _WIN32
assert (exec (p, string (), false, false, false, dir_path (), true));
-#endif
// Transmit large binary data through the child.
//