-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mdx stanza: record env var dependency
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Dune should know about the fact that mdx reads the MDX_RUN_NON_DETERMINISTIC | ||
variable. When using the stanza 0.2, it is the mdx driver that reads that | ||
variable. This is only the case since mdx 2.1.0. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.0) | ||
> (using mdx 0.2) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (mdx (files README.md)) | ||
> EOF | ||
|
||
$ cat > README.md << 'EOF' | ||
> ```ocaml | ||
> # "a";; | ||
> ``` | ||
> | ||
> ```ocaml non-deterministic | ||
> # "b";; | ||
> ``` | ||
> EOF | ||
|
||
$ dune runtest --auto-promote | ||
File "README.md", line 1, characters 0-0: | ||
Error: Files _build/default/README.md and | ||
_build/default/.mdx/README.md.corrected differ. | ||
Promoting _build/default/.mdx/README.md.corrected to README.md. | ||
[1] | ||
|
||
$ cat README.md | ||
```ocaml | ||
# "a";; | ||
- : string = "a" | ||
``` | ||
|
||
```ocaml non-deterministic | ||
# "b";; | ||
``` | ||
|
||
$ dune runtest | ||
|
||
$ MDX_RUN_NON_DETERMINISTIC=1 dune runtest --auto-promote | ||
File "README.md", line 1, characters 0-0: | ||
Error: Files _build/default/README.md and | ||
_build/default/.mdx/README.md.corrected differ. | ||
Promoting _build/default/.mdx/README.md.corrected to README.md. | ||
[1] | ||
|
||
$ cat README.md | ||
```ocaml | ||
# "a";; | ||
- : string = "a" | ||
``` | ||
|
||
```ocaml non-deterministic | ||
# "b";; | ||
- : string = "b" | ||
``` |