| 253 | } |
| 254 | |
| 255 | static int test9(int argc, char const* argv[]) |
| 256 | { |
| 257 | /* Test Ctrl+C behavior: the root test program will send a Ctrl+C to this |
| 258 | process. Here, we start a child process that sleeps for a long time |
| 259 | while ignoring signals. The test is successful if this process waits |
| 260 | for the child to return before exiting from the Ctrl+C handler. |
| 261 | |
| 262 | WARNING: This test will falsely pass if the share parameter of runChild |
| 263 | was set to 0 when invoking the test9 process. */ |
| 264 | int r; |
| 265 | char const* cmd[4]; |
| 266 | (void)argc; |
| 267 | cmd[0] = argv[0]; |
| 268 | cmd[1] = "run"; |
| 269 | cmd[2] = "109"; |
| 270 | cmd[3] = 0; |
| 271 | fprintf(stdout, "Output on stdout before grandchild test.\n"); |
| 272 | fprintf(stderr, "Output on stderr before grandchild test.\n"); |
| 273 | fflush(stdout); |
| 274 | fflush(stderr); |
| 275 | r = runChild(cmd, kwsysProcess_State_Exited, kwsysProcess_Exception_None, 0, |
| 276 | 1, 1, 0, 30, 0, 1, 0, 0, 0); |
| 277 | /* This sleep will avoid a race condition between this function exiting |
| 278 | normally and our Ctrl+C handler exiting abnormally after the process |
| 279 | exits. */ |
| 280 | testProcess_sleep(1); |
| 281 | fprintf(stdout, "Output on stdout after grandchild test.\n"); |
| 282 | fprintf(stderr, "Output on stderr after grandchild test.\n"); |
| 283 | fflush(stdout); |
| 284 | fflush(stderr); |
| 285 | return r; |
| 286 | } |
| 287 | |
| 288 | #if defined(_WIN32) |
| 289 | static BOOL WINAPI test9_grandchild_handler(DWORD dwCtrlType) |
no test coverage detected
searching dependent graphs…