Skip to content

Commit 34873f0

Browse files
Merge pull request #400 from Leonidas-from-XIV/dune-cram-tests
Port `mdx` tests to `cram` tests
2 parents a147f45 + a5b2872 commit 34873f0

File tree

48 files changed

+852
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+852
-1164
lines changed

dune-project

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(lang dune 2.7)
22
(name dune-release)
33

4-
(using mdx 0.1)
54
(cram enable)
65

76
(generate_opam_files true)
@@ -40,5 +39,4 @@ with [Dune](https://github.com/ocaml/dune) and hosted on
4039
logs
4140
odoc
4241
(alcotest :with-test)
43-
(mdx (and :with-test (>= 1.6.0)))
4442
(yojson (>= 1.6))))

dune-release.opam

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ depends: [
3434
"logs"
3535
"odoc"
3636
"alcotest" {with-test}
37-
"mdx" {with-test & >= "1.6.0"}
3837
"yojson" {>= "1.6"}
3938
]
4039
build: [

lib/lint.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ let lint_pkg ~dry_run ~dir ~pkg_name pkg todo =
211211
match total_errs with
212212
| 0 ->
213213
Logs.app (fun m ->
214-
m "%a lint of %a and package %a %a " Text.Pp.status `Ok Text.Pp.path
214+
m "%a lint of %a and package %a %a" Text.Pp.status `Ok Text.Pp.path
215215
dir pp_pkg_name pkg_name
216216
(Fmt.styled `Green Fmt.(any "success"))
217217
());

lib/sos.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ let cmd_error cmd err_msg status =
7070
R.error_msgf "The following command exited with signal %d:@\n %a" c
7171
Cmd.pp cmd
7272
| Some err_msg, `Exited c ->
73-
R.error_msgf "Exit code %d from command @\n `%a`:@\n%s" c Cmd.pp cmd
73+
R.error_msgf "Exit code %d from command@\n `%a`:@\n%s" c Cmd.pp cmd
7474
err_msg
7575
| Some err_msg, `Signaled c ->
7676
R.error_msgf "Signal %d from command @\n `%a`:@\n%s" c Cmd.pp cmd err_msg

tests/bin/check/dune

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(env
22
(_
33
(binaries
4-
(../helpers/make_check_deterministic.exe as make_check_deterministic))))
4+
(../helpers/make_dune_release_deterministic.exe as
5+
make_dune_release_deterministic))))
56

67
(cram
7-
(deps %{bin:dune-release} %{bin:make_check_deterministic}))
8+
(deps %{bin:dune-release} %{bin:make_dune_release_deterministic}))

tests/bin/check/run.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Make a minimal project set up
2727

2828
If the condition described above is fulfilled, there are 4 checks to be performed
2929

30-
$ dune-release check --working-tree | make_check_deterministic
30+
$ dune-release check --working-tree | make_dune_release_deterministic
3131
[-] Checking dune-release compatibility.
3232
[ OK ] The dev-repo field of my_pkg.opam contains a github uri.
3333
[ OK ] The dune project contains a name stanza.
@@ -64,7 +64,7 @@ Add another package
6464

6565
In multi package projects, the whole lint process (including the file lints, even though they are package independent) is done once for every package
6666

67-
$ dune-release check --working-tree | make_check_deterministic
67+
$ dune-release check --working-tree | make_dune_release_deterministic
6868
[-] Checking dune-release compatibility.
6969
[ OK ] The dev-repo field of my_pkg.opam contains a github uri.
7070
[ OK ] The dune project contains a name stanza.
@@ -99,7 +99,7 @@ In multi package projects, the whole lint process (including the file lints, eve
9999

100100
In the same way in which the user can skip the lint check when releasing the tarball, they can also skip it here
101101

102-
$ dune-release check --working-tree --skip-lint | make_check_deterministic
102+
$ dune-release check --working-tree --skip-lint | make_dune_release_deterministic
103103
[-] Checking dune-release compatibility.
104104
[ OK ] The dev-repo field of my_pkg.opam contains a github uri.
105105
[ OK ] The dune project contains a name stanza.
@@ -112,7 +112,7 @@ In the same way in which the user can skip the lint check when releasing the tar
112112

113113
Same for skipping the tests
114114

115-
$ dune-release check --working-tree --skip-lint --skip-test | make_check_deterministic
115+
$ dune-release check --working-tree --skip-lint --skip-test | make_dune_release_deterministic
116116
[-] Checking dune-release compatibility.
117117
[ OK ] The dev-repo field of my_pkg.opam contains a github uri.
118118
[ OK ] The dune project contains a name stanza.

tests/bin/delegate-info/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(cram
2+
(deps %{bin:dune-release}))

tests/bin/delegate-info/run.t

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
We need a basic opam project skeleton
2+
3+
$ cat > CHANGES.md << EOF
4+
> ## 0.1.0
5+
>
6+
> - Some other feature
7+
>
8+
> ## 0.0.0
9+
>
10+
> - Some feature
11+
> EOF
12+
$ touch whatever.opam
13+
$ cat > dune-project << EOF
14+
> (lang dune 2.4)
15+
> (name whatever)
16+
> EOF
17+
18+
We need to set up a git project for dune-release to work properly
19+
20+
$ git init 2> /dev/null > /dev/null
21+
$ git config user.name "dune-release-test"
22+
$ git config user.email "pseudo@pseudo.invalid"
23+
$ git add CHANGES.md whatever.opam dune-project
24+
$ git commit -m "Initial commit" > /dev/null
25+
$ dune-release tag -y > /dev/null
26+
27+
Dune-release delegate-info tarball should print the path to the tarball:
28+
29+
$ dune-release delegate-info tarball
30+
_build/whatever-0.1.0.tbz
31+
32+
Dune-release delegate-info docdir should print the path to the docdir:
33+
34+
$ dune-release delegate-info docdir
35+
_build/default/_doc/_html
36+
37+
Dune-release delegate-info publication-message should print the publication-message:
38+
39+
$ dune-release delegate-info publication-message
40+
CHANGES:
41+
42+
- Some other feature
43+
44+

tests/bin/delegate_info/dune

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/bin/delegate_info/run.t

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)