File tree 2 files changed +20
-15
lines changed
2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -318,15 +318,17 @@ impl TestArgs {
318
318
) ? {
319
319
globals. clear ( ) ;
320
320
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
-
329
321
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
+
330
332
lc. sgl . build_stack_graph_into (
331
333
& mut test. graph ,
332
334
test_fragment. file ,
Original file line number Diff line number Diff line change @@ -100,14 +100,17 @@ fn check_test(
100
100
for fragments in & test. fragments {
101
101
globals. clear ( ) ;
102
102
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
-
110
103
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
+
111
114
build_stack_graph_into (
112
115
& mut test. graph ,
113
116
fragments. file ,
You can’t perform that action at this time.
0 commit comments