File tree Expand file tree Collapse file tree 4 files changed +63
-2
lines changed
test/blackbox-tests/test-cases/mdx-stanza Expand file tree Collapse file tree 4 files changed +63
-2
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ Unreleased
256256
257257- Introduce mdx stanza 0.2, requiring mdx >= 1.9.0, with a new generic ` deps `
258258 field and the possibility to statically link ` libraries ` in the test
259- executable. (#3956 , fixes #3955 )
259+ executable. (#3956 , # 5391 , fixes #3955 )
260260
261261- Improve lookup of optional or disabled binaries. Previously, we'd treat every
262262 executable with missing libraries as optional. Now, we treat make sure to
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ core_bench \
1818"csexp>=1.3.0" \
1919js_of_ocaml \
2020js_of_ocaml-compiler \
21- mdx \
21+ " mdx>=2.1.0" \
2222menhir \
2323"merlin>=3.4.0" \
2424ocamlfind \
Original file line number Diff line number Diff line change @@ -258,6 +258,8 @@ let gen_rules_for_single_file stanza ~sctx ~dir ~expander ~mdx_prog
258258 Dep_conf_eval. unnamed ~expander (mdx_package_deps @ mdx_generic_deps)
259259 in
260260 Action_builder. with_no_targets deps
261+ >>> Action_builder. with_no_targets
262+ (Action_builder. env_var " MDX_RUN_NON_DETERMINISTIC" )
261263 >>> Action_builder. with_no_targets (Action_builder. dyn_deps dyn_deps)
262264 >>> Command. run ~dir: (Path. build dir) ~stdout_to: files.corrected
263265 executable command_line
Original file line number Diff line number Diff line change 1+ Dune should know about the fact that mdx reads the MDX_RUN_NON_DETERMINISTIC
2+ variable. When using the stanza 0.2 , it is the mdx driver that reads that
3+ variable. This is only the case since mdx 2.1 . 0.
4+
5+ $ cat > dune-project << EOF
6+ > (lang dune 3.0 )
7+ > (using mdx 0.2 )
8+ > EOF
9+
10+ $ cat > dune << EOF
11+ > (mdx (files README. md))
12+ > EOF
13+
14+ $ cat > README. md << ' EOF'
15+ > ```ocaml
16+ > # "a";;
17+ > ```
18+ >
19+ > ```ocaml non-deterministic
20+ > # "b";;
21+ > ```
22+ > EOF
23+
24+ $ dune runtest -- auto-promote
25+ File " README.md" , line 1 , characters 0 -0:
26+ Error: Files _build/ default / README. md and
27+ _build/ default /. mdx/ README. md. corrected differ.
28+ Promoting _build/ default /. mdx/ README. md. corrected to README. md.
29+ [1 ]
30+
31+ $ cat README. md
32+ ```ocaml
33+ # "a";;
34+ - : string = " a"
35+ ```
36+
37+ ```ocaml non-deterministic
38+ # "b";;
39+ ```
40+
41+ $ dune runtest
42+
43+ $ MDX_RUN_NON_DETERMINISTIC= 1 dune runtest -- auto-promote
44+ File " README.md" , line 1 , characters 0 -0:
45+ Error: Files _build/ default / README. md and
46+ _build/ default /. mdx/ README. md. corrected differ.
47+ Promoting _build/ default /. mdx/ README. md. corrected to README. md.
48+ [1 ]
49+
50+ $ cat README. md
51+ ```ocaml
52+ # "a";;
53+ - : string = " a"
54+ ```
55+
56+ ```ocaml non-deterministic
57+ # "b";;
58+ - : string = " b"
59+ ```
You can’t perform that action at this time.
0 commit comments