File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change
1
+ extern crate diff;
2
+ #[ macro_use]
3
+ extern crate lazy_static;
1
4
extern crate libbindgen;
2
5
extern crate tempdir;
3
- extern crate diff;
4
6
5
7
use std:: env;
6
8
use std:: fs;
7
9
use std:: io:: { BufReader , BufRead , Read } ;
8
10
use std:: path:: { Path , PathBuf } ;
9
11
use tempdir:: TempDir ;
10
12
13
+ lazy_static ! {
14
+ static ref TEMP_DIR : PathBuf = TempDir :: new( "libbindgen-tests" )
15
+ . expect( "Couldn't create temporary directory" )
16
+ . into_path( ) ;
17
+ }
18
+
11
19
fn spawn_bindgen ( header : & PathBuf , builder : libbindgen:: Builder ) -> Result < ( ) , ( ) > {
12
20
let file_name = header. file_name ( )
13
21
. expect ( "spawn_bindgen expects a file" ) ;
@@ -131,6 +139,10 @@ fn run_bindgen_tests() {
131
139
132
140
let num_failures = failures. len ( ) ;
133
141
142
+ let temp_dir = TEMP_DIR . as_path ( ) ;
143
+ fs:: remove_dir_all ( temp_dir)
144
+ . expect ( format ! ( "Couldn't clean up temporary directory: {:?}" , temp_dir) . as_str ( ) ) ;
145
+
134
146
if num_failures > 0 {
135
147
panic ! ( "{} test failures!" , num_failures) ;
136
148
}
You can’t perform that action at this time.
0 commit comments