Skip to content

Commit 4f923cf

Browse files
authored
Merge pull request #36 from jmid/support-ppxlib-034
Support ppxlib.0.34 and runtest on OCaml 5.3
2 parents cb73154 + ddf6851 commit 4f923cf

File tree

4 files changed

+85
-87
lines changed

4 files changed

+85
-87
lines changed

mutaml.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ build: [
4242
"-j"
4343
jobs
4444
"@install"
45-
"@runtest" {with-test & arch != "ppc64" & arch != "riscv64" & ocaml:version < "5.3"}
45+
"@runtest" {with-test & arch != "ppc64" & arch != "riscv64"}
4646
"@doc" {with-doc}
4747
]
4848
]

test/instrumentation-tests/assert.t

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@ Make an .ml-file:
1212
Quick interlude: This can be useful to observe the parse tree:
1313
---------------------------------------------------------------
1414

15-
$ ocamlc -dparsetree test.ml
16-
[
17-
structure_item (test.ml[1,0+0]..[3,48+22])
18-
Pstr_value Nonrec
19-
[
20-
<def>
21-
pattern (test.ml[1,0+4]..[1,0+7])
22-
Ppat_var "foo" (test.ml[1,0+4]..[1,0+7])
23-
expression (test.ml[1,0+10]..[3,48+22])
24-
Pexp_match
25-
expression (test.ml[1,0+16]..[1,0+29])
26-
Pexp_ident "Sys.word_size" (test.ml[1,0+16]..[1,0+29])
27-
[
28-
<case>
29-
pattern (test.ml[2,35+4]..[2,35+6])
30-
Ppat_constant PConst_int (32,None)
31-
expression (test.ml[2,35+10]..[2,35+12])
32-
Pexp_constant PConst_int (32,None)
33-
<case>
34-
pattern (test.ml[3,48+4]..[3,48+5])
35-
Ppat_any
36-
expression (test.ml[3,48+10]..[3,48+22])
37-
Pexp_assert
38-
expression (test.ml[3,48+17]..[3,48+22])
39-
Pexp_construct "false" (test.ml[3,48+17]..[3,48+22])
40-
None
41-
]
42-
]
43-
]
44-
15+
; $ ocamlc -dparsetree test.ml
16+
; [
17+
; structure_item (test.ml[1,0+0]..[3,48+22])
18+
; Pstr_value Nonrec
19+
; [
20+
; <def>
21+
; pattern (test.ml[1,0+4]..[1,0+7])
22+
; Ppat_var "foo" (test.ml[1,0+4]..[1,0+7])
23+
; expression (test.ml[1,0+10]..[3,48+22])
24+
; Pexp_match
25+
; expression (test.ml[1,0+16]..[1,0+29])
26+
; Pexp_ident "Sys.word_size" (test.ml[1,0+16]..[1,0+29])
27+
; [
28+
; <case>
29+
; pattern (test.ml[2,35+4]..[2,35+6])
30+
; Ppat_constant PConst_int (32,None)
31+
; expression (test.ml[2,35+10]..[2,35+12])
32+
; Pexp_constant PConst_int (32,None)
33+
; <case>
34+
; pattern (test.ml[3,48+4]..[3,48+5])
35+
; Ppat_any
36+
; expression (test.ml[3,48+10]..[3,48+22])
37+
; Pexp_assert
38+
; expression (test.ml[3,48+17]..[3,48+22])
39+
; Pexp_construct "false" (test.ml[3,48+17]..[3,48+22])
40+
; None
41+
; ]
42+
; ]
43+
; ]
44+
4545
----------------------------------------------------------------------------------
4646
Test mutation of the 'assert false':
4747
----------------------------------------------------------------------------------

test/instrumentation-tests/match.t

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,61 +11,59 @@ Make an .ml-file:
1111

1212
This gets parsed to the following syntax tree:
1313

14-
$ ocamlc -dparsetree test.ml
15-
[
16-
structure_item (test.ml[1,0+0]..[3,88+50])
17-
Pstr_value Nonrec
18-
[
19-
<def>
20-
pattern (test.ml[1,0+4]..[1,0+6])
21-
Ppat_construct "()" (test.ml[1,0+4]..[1,0+6])
22-
None
23-
expression (test.ml[1,0+9]..[3,88+50])
24-
Pexp_match
25-
expression (test.ml[1,0+15]..[1,0+31])
26-
Pexp_apply
27-
expression (test.ml[1,0+15]..[1,0+16])
28-
Pexp_ident "!" (test.ml[1,0+15]..[1,0+16])
29-
[
30-
<arg>
31-
Nolabel
32-
expression (test.ml[1,0+16]..[1,0+31])
33-
Pexp_ident "Sys.interactive" (test.ml[1,0+16]..[1,0+31])
34-
]
35-
[
36-
<case>
37-
pattern (test.ml[2,37+4]..[2,37+9])
38-
Ppat_construct "false" (test.ml[2,37+4]..[2,37+9])
39-
None
40-
expression (test.ml[2,37+13]..[2,37+50])
41-
Pexp_apply
42-
expression (test.ml[2,37+13]..[2,37+26])
43-
Pexp_ident "print_endline" (test.ml[2,37+13]..[2,37+26])
44-
[
45-
<arg>
46-
Nolabel
47-
expression (test.ml[2,37+27]..[2,37+50])
48-
Pexp_constant PConst_string("Running in batch mode",(test.ml[2,37+28]..[2,37+49]),None)
49-
]
50-
<case>
51-
pattern (test.ml[3,88+4]..[3,88+8])
52-
Ppat_construct "true" (test.ml[3,88+4]..[3,88+8])
53-
None
54-
expression (test.ml[3,88+13]..[3,88+50])
55-
Pexp_apply
56-
expression (test.ml[3,88+13]..[3,88+26])
57-
Pexp_ident "print_endline" (test.ml[3,88+13]..[3,88+26])
58-
[
59-
<arg>
60-
Nolabel
61-
expression (test.ml[3,88+27]..[3,88+50])
62-
Pexp_constant PConst_string("Running interactively",(test.ml[3,88+28]..[3,88+49]),None)
63-
]
64-
]
65-
]
66-
]
67-
68-
14+
; $ ocamlc -dparsetree test.ml
15+
; [
16+
; structure_item (test.ml[1,0+0]..[3,88+50])
17+
; Pstr_value Nonrec
18+
; [
19+
; <def>
20+
; pattern (test.ml[1,0+4]..[1,0+6])
21+
; Ppat_construct "()" (test.ml[1,0+4]..[1,0+6])
22+
; None
23+
; expression (test.ml[1,0+9]..[3,88+50])
24+
; Pexp_match
25+
; expression (test.ml[1,0+15]..[1,0+31])
26+
; Pexp_apply
27+
; expression (test.ml[1,0+15]..[1,0+16])
28+
; Pexp_ident "!" (test.ml[1,0+15]..[1,0+16])
29+
; [
30+
; <arg>
31+
; Nolabel
32+
; expression (test.ml[1,0+16]..[1,0+31])
33+
; Pexp_ident "Sys.interactive" (test.ml[1,0+16]..[1,0+31])
34+
; ]
35+
; [
36+
; <case>
37+
; pattern (test.ml[2,37+4]..[2,37+9])
38+
; Ppat_construct "false" (test.ml[2,37+4]..[2,37+9])
39+
; None
40+
; expression (test.ml[2,37+13]..[2,37+50])
41+
; Pexp_apply
42+
; expression (test.ml[2,37+13]..[2,37+26])
43+
; Pexp_ident "print_endline" (test.ml[2,37+13]..[2,37+26])
44+
; [
45+
; <arg>
46+
; Nolabel
47+
; expression (test.ml[2,37+27]..[2,37+50])
48+
; Pexp_constant PConst_string("Running in batch mode",(test.ml[2,37+28]..[2,37+49]),None)
49+
; ]
50+
; <case>
51+
; pattern (test.ml[3,88+4]..[3,88+8])
52+
; Ppat_construct "true" (test.ml[3,88+4]..[3,88+8])
53+
; None
54+
; expression (test.ml[3,88+13]..[3,88+50])
55+
; Pexp_apply
56+
; expression (test.ml[3,88+13]..[3,88+26])
57+
; Pexp_ident "print_endline" (test.ml[3,88+13]..[3,88+26])
58+
; [
59+
; <arg>
60+
; Nolabel
61+
; expression (test.ml[3,88+27]..[3,88+50])
62+
; Pexp_constant PConst_string("Running interactively",(test.ml[3,88+28]..[3,88+49]),None)
63+
; ]
64+
; ]
65+
; ]
66+
; ]
6967

7068

7169
Let's first compile and run the example

test/negative-tests/ppx-negtests.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Instrument and check that it was received
228228
> )
229229
> EOF
230230
231-
$ bash ../filter_dune_build.sh ./test.bc --instrument-with mutaml 2>&1 | grep -v "no-merge" | grep -v "Embed errors"
231+
$ bash ../filter_dune_build.sh ./test.bc --instrument-with mutaml 2>&1 | grep -v "no-merge\|Embed errors\|keywords"
232232
ppx.exe [extra_args] [<files>]
233233
-as-ppx Run as a -ppx rewriter (must be the first argument)
234234
--as-ppx Same as -as-ppx

0 commit comments

Comments
 (0)