This repository was archived by the owner on Apr 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ fn to_debug_str(debug: &dyn Debug) -> String {
1515
1616macro_rules! snapshot {
1717 ( $production: ident, $src: expr) => { {
18- let tts = $src. parse:: <proc_macro2:: TokenStream >( ) . expect( "tokenization" ) ;
18+ let tts = $src
19+ . parse:: <proc_macro2:: TokenStream >( )
20+ . expect( "tokenization" ) ;
1921 to_debug_str( & parse:: $production:: parse( tts) )
2022 } } ;
2123}
@@ -74,10 +76,15 @@ fn test_snapshot(file: walkdir::DirEntry) {
7476 assert_snapshot_matches ! ( file_name, forest) ;
7577}
7678
77- fn spawn_panicking ( stack_size : usize , f : impl FnOnce ( ) + Send + ' static ) -> Result < ( ) , ( ) > {
79+ fn spawn_panicking (
80+ name : String ,
81+ stack_size : usize ,
82+ f : impl FnOnce ( ) + Send + ' static ,
83+ ) -> Result < ( ) , ( ) > {
7884 crossbeam:: scope ( |scope : & crossbeam:: thread:: Scope < ' _ > | {
7985 scope
8086 . builder ( )
87+ . name ( name)
8188 . stack_size ( stack_size)
8289 . spawn ( |_| f ( ) )
8390 . unwrap ( )
@@ -98,7 +105,13 @@ fn main() {
98105 // Parse and snapshot each file
99106 let snapshots = files
100107 // .par_bridge() // parallel will interleave output, unfortunately
101- . map ( |f| spawn_panicking ( 32 * 1024 * 1024 , || test_snapshot ( f) ) ) ; // 32 MiB
108+ . map ( |f| {
109+ spawn_panicking (
110+ f. file_name ( ) . to_string_lossy ( ) . into_owned ( ) ,
111+ 32 * 1024 * 1024 , // 32 MiB
112+ || test_snapshot ( f) ,
113+ )
114+ } ) ;
102115
103116 // Collect failures
104117 let failures: Vec < _ > = snapshots. filter_map ( Result :: err) . collect ( ) ;
You can’t perform that action at this time.
0 commit comments