From df2c5fcf20189750119a94ca8b91f92f5d65d758 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 21 Jul 2017 00:23:19 +0300 Subject: Add support for passing environment variables to child process on Windows --- tests/process/driver.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'tests/process') 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. // -- cgit v1.1