Commit 4971e99
committed
Fix switch_stdout_to on Windows7
The switch_stdout_to test was broken on Windows7, as the test
infrastructure would refuse to delete the temporary test folder because
the switch-stdout-output file we redirected the stdout to was still
opened.
To fix this issue, we make switch_stdout_to return the previous handle,
and add a new switch_stdout_to call at the end of the test to return the
stdio handles to their original state. The handle the second
switch_stdout_to returns will be automatically closed, which should
allow the temporary test folder to be deleted properly.1 parent 91bbdd9 commit 4971e99
1 file changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | | - | |
| 33 | + | |
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
| 42 | + | |
30 | 43 | | |
31 | 44 | | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
| 49 | + | |
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
| |||
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
46 | | - | |
| 62 | + | |
47 | 63 | | |
48 | 64 | | |
49 | 65 | | |
| 66 | + | |
| 67 | + | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| |||
0 commit comments