forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a (locks) field to the mdx stanza. This field is versioned against dune lang (not the extension). Tests are a bit flaky for now. Closes: ocaml#5489 Signed-off-by: Etienne Millon <[email protected]>
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
With interleaving | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.2) | ||
> (using mdx 0.2) | ||
> EOF | ||
|
||
$ mkdir a b | ||
|
||
$ cat > a/dune << EOF | ||
> (mdx) | ||
> EOF | ||
|
||
$ cp a/dune b/dune | ||
|
||
$ cat > a/README.md << 'EOF' | ||
> ```sh | ||
> $ echo begin a >> ../../../log.txt | ||
> $ sleep 1 | ||
> $ echo end a >> ../../../log.txt | ||
> ``` | ||
> EOF | ||
|
||
$ cat > b/README.md << 'EOF' | ||
> ```sh | ||
> $ echo begin b >> ../../../log.txt | ||
> $ sleep 1 | ||
> $ echo end b >> ../../../log.txt | ||
> ``` | ||
> EOF | ||
|
||
$ dune runtest -j 4 | ||
|
||
$ cat log.txt | ||
begin a | ||
begin b | ||
end a | ||
end b | ||
|
||
$ dune clean | ||
|
||
Without interleaving | ||
|
||
$ cat > a/dune << EOF | ||
> (mdx | ||
> (locks /l)) | ||
$ cp a/dune b/dune | ||
|
||
$ rm log.txt | ||
|
||
$ dune runtest -j 4 | ||
|
||
$ cat log.txt | ||
begin a | ||
end a | ||
begin b | ||
end b | ||
|
||
Version check | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.1) | ||
> (using mdx 0.2) | ||
> EOF | ||
|
||
$ dune runtest | ||
File "a/dune", line 2, characters 1-11: | ||
2 | (locks /l)) | ||
^^^^^^^^^^ | ||
Error: 'locks' is only available since version 3.2 of the dune language. | ||
Please update your dune-project file to have (lang dune 3.2). | ||
[1] |