| 325 | } |
| 326 | |
| 327 | void SC::ProcessTest::processEnvironmentNewVar() |
| 328 | { |
| 329 | //! [ProcessEnvironmentNewVar] |
| 330 | Process process(commandArena.toSpan(), environmentArena.toSpan()); |
| 331 | // This child process will inherit parent environment variables plus NewEnvVar |
| 332 | SC_TEST_EXPECT(process.setEnvironment("NewEnvVar", "SomeValue")); |
| 333 | String output; |
| 334 | // Spawn the child process writing all env variables as KEY=VALUE\n to stdout, redirected to output |
| 335 | SC_TEST_EXPECT(spawnChildAndPrintEnvironmentVars(process, output)); |
| 336 | // We can check that the NewEnvVar has been set to SomeValue |
| 337 | StringView out = output.view(); |
| 338 | SC_TEST_EXPECT(out.containsString("NewEnvVar=SomeValue")); |
| 339 | // PATH env var exists because we are inheriting environment |
| 340 | SC_TEST_EXPECT(out.containsString("PATH=")); |
| 341 | //! [ProcessEnvironmentNewVar] |
| 342 | } |
| 343 | |
| 344 | void SC::ProcessTest::processEnvironmentRedefineParentVar() |
| 345 | { |
nothing calls this directly
no test coverage detected