-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathocaml_tests.ml
141 lines (128 loc) · 3.31 KB
/
ocaml_tests.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Sebastien Hinderer, projet Gallium, INRIA Paris *)
(* *)
(* Copyright 2016 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(* Tests specific to the OCaml compiler *)
open Tests
open Builtin_actions
open Ocaml_actions
let bytecode =
let opt_actions =
[
setup_ocamlc_opt_build_env;
ocamlc_opt;
check_ocamlc_opt_output;
compare_bytecode_programs
] in
{
test_name = "bytecode";
test_run_by_default = true;
test_actions =
[
setup_ocamlc_byte_build_env;
ocamlc_byte;
check_ocamlc_byte_output;
run;
check_program_output;
] @ (if Ocamltest_config.arch<>"none" then opt_actions else [])
}
let native =
let opt_actions =
[
setup_ocamlopt_byte_build_env;
ocamlopt_byte;
check_ocamlopt_byte_output;
run;
check_program_output;
setup_ocamlopt_opt_build_env;
ocamlopt_opt;
check_ocamlopt_opt_output;
] in
{
test_name = "native";
test_run_by_default = true;
test_actions =
(if Ocamltest_config.native_compiler then opt_actions else [skip])
}
let toplevel = {
test_name = "toplevel";
test_run_by_default = false;
test_actions =
[
setup_ocaml_build_env;
ocaml;
check_ocaml_output;
(*
setup_ocamlnat_build_env;
ocamlnat;
check_ocamlnat_output;
*)
]
}
let expect =
{
test_name = "expect";
test_run_by_default = false;
test_actions =
[
setup_simple_build_env;
run_expect;
check_program_output
]
}
let ocamldoc =
{
test_name = "ocamldoc";
test_run_by_default = false;
test_actions =
if Ocamltest_config.ocamldoc then
[
shared_libraries;
setup_ocamldoc_build_env;
run_ocamldoc;
check_program_output;
check_ocamldoc_output
]
else
[ skip ]
}
let asmgen_skip_on_bytecode_only =
Actions_helpers.skip_with_reason "native compiler disabled"
let msvc64 =
Ocamltest_config.ccomptype = "msvc" && Ocamltest_config.arch="amd64"
let asmgen_skip_on_msvc64 =
Actions_helpers.skip_with_reason "not ported to MSVC64 yet"
let asmgen_actions =
if not Ocamltest_config.native_compiler then [asmgen_skip_on_bytecode_only]
else if msvc64 then [asmgen_skip_on_msvc64]
else [
setup_simple_build_env;
codegen;
cc;
]
let asmgen =
{
test_name = "asmgen";
test_run_by_default = false;
test_actions = asmgen_actions
}
let _ =
List.iter register
[
bytecode;
native;
toplevel;
expect;
ocamldoc;
asmgen;
]