File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
test/blackbox-tests/test-cases/stanzas/tests Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 11- Start sandboxing the execution of tests defined with the ` test ` and ` tests `
2- stanzas (#13510 , @rgrinberg )
2+ stanzas (#13510 , # 13617 , @rgrinberg )
Original file line number Diff line number Diff line change @@ -135,13 +135,18 @@ let rules (t : Tests.t) ~sctx ~dir ~scope ~expander ~dir_contents =
135135 |> Rules.Produce.Alias. add_deps runtest_alias)
136136 in
137137 let expander = Expander. add_bindings expander ~bindings: extra_bindings in
138+ let sandbox =
139+ if Dune_project. dune_version project > = (3 , 22 )
140+ then Sandbox_config. needs_sandboxing
141+ else Sandbox_config. no_special_requirements
142+ in
138143 match test_kind ~dir: (Expander. dir expander) dir_contents s ext with
139144 | `Regular ->
140145 let action =
141146 let chdir = Expander. dir expander in
142147 Action_unexpanded. expand_no_targets
143148 run_action
144- Sandbox_config. no_special_requirements
149+ sandbox
145150 ~loc
146151 ~expander
147152 ~chdir
@@ -161,12 +166,10 @@ let rules (t : Tests.t) ~sctx ~dir ~scope ~expander ~dir_contents =
161166 ~loc
162167 ~expander
163168 ~deps
164- ~targets: Targets_spec. Infer
169+ ~targets: Infer
165170 ~targets_dir: dir
166171 run_action
167- (if Dune_project. dune_version project > = (3 , 22 )
168- then Sandbox_config. needs_sandboxing
169- else Sandbox_config. no_special_requirements)
172+ sandbox
170173 in
171174 Action_builder.With_targets. add action ~file_targets: [ diff.file2 ]
172175 |> Action_builder.With_targets. map_build ~f: (fun action ->
Original file line number Diff line number Diff line change @@ -23,3 +23,4 @@ Demonstrate that test stanza is now sandbox
2323
2424 $ make_dune_project 3.22
2525 $ dune runtest dir/ foo
26+ foo. exe
You can’t perform that action at this time.
0 commit comments