File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ use tempfile::tempfile;
15
15
use tempdir:: TempDir ;
16
16
use libc:: off_t;
17
17
18
+ /// Run a test in a subprocess
19
+ ///
20
+ /// This is useful for tests that change a process-level property, like the cwd
21
+ /// or a signal handler.
22
+ ///
23
+ /// # Arguments
24
+ ///
25
+ /// * `func` - function to run in the subprocess. It should exit 0 on success
26
+ /// or nonzero on failure. The usual `assert` functions will do the right
27
+ /// thing.
18
28
fn test_in_subprocess < F : Fn ( ) > ( func : F ) {
19
29
let pid = fork ( ) ;
20
30
match pid {
@@ -190,7 +200,6 @@ fn test_getcwd() {
190
200
let mut inner_tmp_dir = tmp_dir. path ( ) . to_path_buf ( ) ;
191
201
for _ in 0 ..5 {
192
202
let newdir = iter:: repeat ( "a" ) . take ( 100 ) . collect :: < String > ( ) ;
193
- //inner_tmp_dir = inner_tmp_dir.join(newdir).path();
194
203
inner_tmp_dir. push ( newdir) ;
195
204
assert ! ( mkdir( inner_tmp_dir. as_path( ) , stat:: S_IRWXU ) . is_ok( ) ) ;
196
205
}
You can’t perform that action at this time.
0 commit comments