This repository was archived by the owner on Sep 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed
Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -318,15 +318,17 @@ impl TestArgs {
318318 ) ? {
319319 globals. clear ( ) ;
320320
321- // Add FILE_PATH to variables
322- globals
323- . add (
324- FILE_PATH_VAR . into ( ) ,
325- test_fragment. path . to_str ( ) . unwrap ( ) . into ( ) ,
326- )
327- . expect ( "failed to add file path variable" ) ;
328-
329321 test_fragment. add_globals_to ( & mut globals) ;
322+
323+ if globals. get ( & FILE_PATH_VAR . into ( ) ) . is_none ( ) {
324+ globals
325+ . add (
326+ FILE_PATH_VAR . into ( ) ,
327+ test_fragment. path . to_str ( ) . unwrap ( ) . into ( ) ,
328+ )
329+ . expect ( "failed to add file path variable" ) ;
330+ }
331+
330332 lc. sgl . build_stack_graph_into (
331333 & mut test. graph ,
332334 test_fragment. file ,
Original file line number Diff line number Diff line change @@ -100,14 +100,17 @@ fn check_test(
100100 for fragments in & test. fragments {
101101 globals. clear ( ) ;
102102
103- globals
104- . add (
105- FILE_PATH_VAR . into ( ) ,
106- fragments. path . to_str ( ) . unwrap ( ) . into ( ) ,
107- )
108- . expect ( "failed to add file path variable" ) ;
109-
110103 fragments. add_globals_to ( & mut globals) ;
104+
105+ if globals. get ( & FILE_PATH_VAR . into ( ) ) . is_none ( ) {
106+ globals
107+ . add (
108+ FILE_PATH_VAR . into ( ) ,
109+ fragments. path . to_str ( ) . unwrap ( ) . into ( ) ,
110+ )
111+ . expect ( "failed to add file path variable" ) ;
112+ }
113+
111114 build_stack_graph_into (
112115 & mut test. graph ,
113116 fragments. file ,
You can’t perform that action at this time.
0 commit comments