Skip to content

Commit 34e4b0a

Browse files
committed
OxCaml support: update tests
1 parent ff16bf6 commit 34e4b0a

File tree

8 files changed

+50
-24
lines changed

8 files changed

+50
-24
lines changed

compiler/tests-compiler/double-translation/dune.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
(modules effects_continuations)
2222
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
2323
(inline_tests
24-
(enabled_if true)
24+
(enabled_if (not %{oxcaml_supported}))
2525
(deps
2626
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
2727
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -36,7 +36,7 @@
3636
(modules effects_exceptions)
3737
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
3838
(inline_tests
39-
(enabled_if true)
39+
(enabled_if (not %{oxcaml_supported}))
4040
(deps
4141
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
4242
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))

compiler/tests-compiler/dune.inc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
(modules effects)
9797
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
9898
(inline_tests
99-
(enabled_if true)
99+
(enabled_if (not %{oxcaml_supported}))
100100
(deps
101101
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
102102
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -111,7 +111,7 @@
111111
(modules effects_continuations)
112112
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
113113
(inline_tests
114-
(enabled_if true)
114+
(enabled_if (not %{oxcaml_supported}))
115115
(deps
116116
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
117117
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -126,7 +126,7 @@
126126
(modules effects_exceptions)
127127
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
128128
(inline_tests
129-
(enabled_if true)
129+
(enabled_if (not %{oxcaml_supported}))
130130
(deps
131131
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
132132
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -156,7 +156,7 @@
156156
(modules eliminate_exception_handler)
157157
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
158158
(inline_tests
159-
(enabled_if true)
159+
(enabled_if (not %{oxcaml_supported}))
160160
(deps
161161
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
162162
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -231,7 +231,7 @@
231231
(modules exceptions)
232232
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
233233
(inline_tests
234-
(enabled_if true)
234+
(enabled_if (not %{oxcaml_supported}))
235235
(deps
236236
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
237237
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -336,7 +336,7 @@
336336
(modules gh1354)
337337
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
338338
(inline_tests
339-
(enabled_if true)
339+
(enabled_if (not %{oxcaml_supported}))
340340
(deps
341341
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
342342
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -456,7 +456,7 @@
456456
(modules gh1868)
457457
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
458458
(inline_tests
459-
(enabled_if true)
459+
(enabled_if (not %{oxcaml_supported}))
460460
(deps
461461
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
462462
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -486,7 +486,7 @@
486486
(modules gh747)
487487
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
488488
(inline_tests
489-
(enabled_if true)
489+
(enabled_if (not %{oxcaml_supported}))
490490
(deps
491491
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
492492
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -516,7 +516,7 @@
516516
(modules global_deadcode)
517517
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
518518
(inline_tests
519-
(enabled_if true)
519+
(enabled_if (not %{oxcaml_supported}))
520520
(deps
521521
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
522522
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -606,7 +606,7 @@
606606
(modules loops)
607607
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
608608
(inline_tests
609-
(enabled_if true)
609+
(enabled_if (not %{oxcaml_supported}))
610610
(deps
611611
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
612612
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))
@@ -681,7 +681,7 @@
681681
(modules obj)
682682
(libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper)
683683
(inline_tests
684-
(enabled_if (>= %{ocaml_version} 5))
684+
(enabled_if (and (>= %{ocaml_version} 5) (not %{oxcaml_supported})))
685685
(deps
686686
(file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe)
687687
(file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe)))

compiler/tests-compiler/gen-rules/gen.ml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ type enabled_if =
5151
| GE52
5252
| LT52
5353
| B64
54+
| NotOxCaml
55+
| GE5NotOxCaml
5456
| Any
5557

5658
let lib_enabled_if = function
@@ -59,10 +61,21 @@ let lib_enabled_if = function
5961
| _ -> Any
6062

6163
let test_enabled_if = function
62-
| "obj" | "lazy" -> GE5
64+
| "obj" -> GE5NotOxCaml (* Some Obj functions are no longer primitives *)
65+
| "lazy" -> GE5
6366
| "gh1051" -> B64
6467
| "rec52" -> GE52
6568
| "rec" -> LT52
69+
| "gh1354"
70+
| "gh1868"
71+
| "exceptions"
72+
| "effects_continuations"
73+
| "effects_exceptions"
74+
| "eliminate_exception_handler"
75+
| "loops"
76+
| "global_deadcode" -> NotOxCaml (* In OxCaml, raise is always reraise *)
77+
| "effects" -> NotOxCaml (* Call to Printf.printf is somehow compiled differently *)
78+
| "gh747" -> NotOxCaml (* More debug locations *)
6679
| _ -> Any
6780

6881
let enabled_if = function
@@ -71,6 +84,8 @@ let enabled_if = function
7184
| GE52 -> "(>= %{ocaml_version} 5.2)"
7285
| LT52 -> "(< %{ocaml_version} 5.2)"
7386
| B64 -> "%{arch_sixtyfour}"
87+
| GE5NotOxCaml -> "(and (>= %{ocaml_version} 5) (not %{oxcaml_supported}))"
88+
| NotOxCaml -> "(not %{oxcaml_supported})"
7489

7590
let () =
7691
Array.to_list (Sys.readdir ".")

compiler/tests-jsoo/dune

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
(modules test_marshal_compressed)
2121
(libraries unix compiler-libs.common js_of_ocaml-compiler)
2222
(enabled_if
23-
(>= %{ocaml_version} 5.1.1))
23+
(and
24+
(>= %{ocaml_version} 5.1.1)
25+
(not %{oxcaml_supported})))
2426
(inline_tests
2527
(modes js wasm best))
2628
(preprocess

compiler/tests-jsoo/gh_1307.ml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ let test content =
55
| n ->
66
Printf.printf "%d\n" n;
77
print_endline "success"
8-
| exception e ->
9-
print_endline (Printexc.to_string e);
10-
print_endline "failure"
8+
| exception Parsing.Parse_error -> print_endline "Parse_error"
119

1210
let%expect_test "parsing" =
1311
(* use [Parsing.set_trace true] once https://github.com/janestreet/ppx_expect/issues/43 is fixed *)
1412
let (old : bool) = Parsing.set_trace false in
1513
test "a";
1614
[%expect {|
1715
input: "a"
18-
Stdlib.Parsing.Parse_error
19-
failure |}];
16+
Parse_error |}];
2017
test "aa";
2118
[%expect {|
2219
input: "aa"
@@ -25,7 +22,6 @@ let%expect_test "parsing" =
2522
test "aaa";
2623
[%expect {|
2724
input: "aaa"
28-
Stdlib.Parsing.Parse_error
29-
failure |}];
25+
Parse_error |}];
3026
let (_ : bool) = Parsing.set_trace old in
3127
()

compiler/tests-linkall/dune

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
(js_of_ocaml
66
(compilation_mode separate))
77
(wasm_of_ocaml
8+
; dynlink not compiling
9+
(enabled_if
10+
(not %{oxcaml_supported}))
811
(compilation_mode separate))))
912

1013
(test

compiler/tests-ocaml/basic-more/dune

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
div_by_zero
55
function_in_ref
66
if_in_if
7-
labels_evaluation_order
87
morematch
98
opaque_prim
109
pr10294
@@ -24,3 +23,12 @@
2423
(build_if
2524
(>= %{ocaml_version} 5.2))
2625
(modes js wasm))
26+
27+
(tests
28+
(names labels_evaluation_order)
29+
(libraries ocaml_testing)
30+
(build_if
31+
(and
32+
(>= %{ocaml_version} 5.2)
33+
(not %{oxcaml_supported})))
34+
(modes js wasm))

compiler/tests-ocaml/lib-marshal/dune

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
(names compressed)
33
(libraries compiler-libs.common)
44
(build_if
5-
(>= %{ocaml_version} 5.2))
5+
(and
6+
(>= %{ocaml_version} 5.2)
7+
(not %{oxcaml_supported})))
68
(modes js wasm))
79

810
(tests

0 commit comments

Comments
 (0)