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.
Split tests to allow multiple simultaneous jobs.
The alias `@all-mdx-tests` runs all the mdx tests. Signed-off-by: Ulysse Gérard <[email protected]>
- Loading branch information
Showing
56 changed files
with
135 additions
and
131 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
test/blackbox-tests/test-cases/mdx-stanza.t/lang-version/dune-project
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
(cram | ||
(applies_to :whole_subtree) | ||
(alias all-mdx-tests)) |
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
test/blackbox-tests/test-cases/mdx-stanza/lang-version.t/run.t
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,38 @@ | ||
The MDX stanza requires dune lang 2.4 or higher | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.3) | ||
> (using mdx 0.1) | ||
> EOF | ||
|
||
$ dune build @install | ||
File "dune-project", line 2, characters 11-14: | ||
2 | (using mdx 0.1) | ||
^^^ | ||
Warning: Version 0.1 of mdx extension to verify code blocks in .md files is | ||
not supported until version 2.4 of the dune language. | ||
There are no supported versions of this extension in version 2.3 of the dune | ||
language. | ||
|
||
File "dune", line 1, characters 0-5: | ||
1 | (mdx) | ||
^^^^^ | ||
Error: 'mdx' is only available since version 2.4 of the dune language. Please | ||
update your dune-project file to have (lang dune 2.4). | ||
[1] | ||
|
||
The version 0.2 requires dune 2.8 | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.7) | ||
> (using mdx 0.2) | ||
> EOF | ||
$ dune build @install | ||
File "dune-project", line 2, characters 11-14: | ||
2 | (using mdx 0.2) | ||
^^^ | ||
Error: Version 0.2 of mdx extension to verify code blocks in .md files is not | ||
supported until version 2.8 of the dune language. | ||
Supported versions of this extension in version 2.7 of the dune language: | ||
- 0.1 | ||
[1] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
test/blackbox-tests/test-cases/mdx-stanza/linked-libraries.t/run.t
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,24 @@ | ||
Since 0.2 you can use the `libraries` field to have them linked into the test executable | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.8) | ||
> (using mdx 0.2) | ||
> EOF | ||
|
||
$ dune runtest | ||
|
||
MDX stanza 0.1 does not support linking libraries | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.8) | ||
> (using mdx 0.1) | ||
> EOF | ||
|
||
$ dune runtest | ||
File "dune", line 3, characters 1-24: | ||
3 | (libraries private_lib)) | ||
^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: 'libraries' is only available since version 0.2 of mdx extension to | ||
verify code blocks in .md files. Please update your dune-project file to have | ||
(using mdx 0.2). | ||
[1] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
test/blackbox-tests/test-cases/mdx-stanza/local-package-unrelated.t/run.t
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,13 @@ | ||
Dune does not fail if the `packages` are not available at evaluation time | ||
(regression test fixed by ocaml/dune#3650) | ||
|
||
$ dune build -p unrelated-package | ||
|
||
Dune fails if the `packages` are not avaliable at execution time | ||
|
||
$ dune runtest -p unrelated-package | ||
File "dune", line 3, characters 11-14: | ||
3 | (packages pkg)) | ||
^^^ | ||
Error: Package pkg does not exist | ||
[1] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/mdx-stanza/local-package.t/run.t
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,4 @@ | ||
You can make local packages available to mdx by using the `packages` field of | ||
the stanza | ||
|
||
$ dune runtest |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,4 @@ | ||
Dune should invoke `ocaml-mdx deps` to figure out the files and directories a markdown | ||
or mli to-be-mdxed file depends upon | ||
|
||
$ dune runtest |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
You can use the mdx stanza to check your documentation in markdown and mli files | ||
|
||
$ dune runtest | ||
File "README.md", line 1, characters 0-0: | ||
Error: Files _build/default/README.md and | ||
_build/default/.mdx/README.md.corrected differ. | ||
[1] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
test/blackbox-tests/test-cases/mdx-stanza/new-deps-field.t/run.t
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,30 @@ | ||
Since version 0.2 the mdx stanza supports a more genereic `deps` field. | ||
A deprecation warning is raised if using the olf `packages` field. | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.8) | ||
> (using mdx 0.2) | ||
> EOF | ||
|
||
$ dune runtest | ||
File "dune", line 4, characters 1-15: | ||
4 | (packages pkg)) | ||
^^^^^^^^^^^^^^ | ||
Warning: 'packages' was deprecated in version 0.2 of mdx extension to verify | ||
code blocks in .md files. | ||
|
||
But using the new field with the old stanza would fail | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.8) | ||
> (using mdx 0.1) | ||
> EOF | ||
|
||
$ dune runtest | ||
File "dune", line 3, characters 1-22: | ||
3 | (deps (package pkg2)) | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
Error: 'deps' is only available since version 0.2 of mdx extension to verify | ||
code blocks in .md files. Please update your dune-project file to have (using | ||
mdx 0.2). | ||
[1] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
You can set MDX preludes using the preludes field of the stanza | ||
|
||
$ dune runtest |
File renamed without changes.
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,9 @@ | ||
$ cat >dune-project <<EOF | ||
> (lang dune 2.4) | ||
> EOF | ||
|
||
To use the mdx stanza you need to explicitly set (using mdx ..) in the | ||
dune-project | ||
|
||
$ dune build @install | ||
Info: Appending this line to dune-project: (using mdx 0.1) |