@@ -29,6 +29,7 @@ use crate::loader::LanguageConfiguration;
2929use crate :: loader:: Loader ;
3030use crate :: test:: Test ;
3131use crate :: test:: TestResult ;
32+ use crate :: CancellationFlag ;
3233use crate :: LoadError ;
3334use crate :: NoCancellation ;
3435use crate :: StackGraphLanguage ;
@@ -205,8 +206,10 @@ impl TestArgs {
205206 test_path : & Path ,
206207 loader : & mut Loader ,
207208 ) -> anyhow:: Result < TestResult > {
209+ let cancellation_flag = & NoCancellation ;
210+
208211 let mut file_reader = FileReader :: new ( ) ;
209- let lc = match loader. load_for_file ( test_path, & mut file_reader, & NoCancellation ) ? {
212+ let lc = match loader. load_for_file ( test_path, & mut file_reader, cancellation_flag ) ? {
210213 Some ( sgl) => sgl,
211214 None => {
212215 if self . show_ignored {
@@ -235,7 +238,7 @@ impl TestArgs {
235238 & test_fragment. source ,
236239 & mut all_paths,
237240 & test_fragment. globals ,
238- & NoCancellation ,
241+ cancellation_flag ,
239242 ) ?;
240243 } else if lc. matches_file (
241244 & test_fragment. path ,
@@ -250,6 +253,7 @@ impl TestArgs {
250253 & test_fragment. source ,
251254 & globals,
252255 & mut test. graph ,
256+ cancellation_flag,
253257 ) ?;
254258 } else {
255259 return Err ( anyhow ! (
@@ -259,7 +263,7 @@ impl TestArgs {
259263 ) ) ;
260264 }
261265 }
262- let result = test. run ( & NoCancellation ) ?;
266+ let result = test. run ( cancellation_flag ) ?;
263267 let success = self . handle_result ( test_path, & result) ?;
264268 if self . output_mode . test ( !success) {
265269 let files = test. fragments . iter ( ) . map ( |f| f. file ) . collect :: < Vec < _ > > ( ) ;
@@ -294,8 +298,9 @@ impl TestArgs {
294298 source : & str ,
295299 globals : & Variables ,
296300 graph : & mut StackGraph ,
301+ cancellation_flag : & dyn CancellationFlag ,
297302 ) -> anyhow:: Result < ( ) > {
298- match sgl. build_stack_graph_into ( graph, file, source, globals, & NoCancellation ) {
303+ match sgl. build_stack_graph_into ( graph, file, source, globals, cancellation_flag ) {
299304 Err ( LoadError :: ParseErrors ( parse_errors) ) => {
300305 Err ( map_parse_errors ( test_path, & parse_errors, source, " " ) )
301306 }
0 commit comments