Skip to content

Commit 42ab88e

Browse files
authored
flambda-backend: Disable bytecode compilers in ocamltest (#504)
1 parent 58c72d5 commit 42ab88e

File tree

2 files changed

+37
-38
lines changed

2 files changed

+37
-38
lines changed

ocamltest/ocaml_compilers.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,10 @@ class compiler
4040
method target = target
4141

4242
method program_variable =
43-
if Ocaml_backends.is_native host
44-
then Builtin_variables.program2
45-
else Builtin_variables.program
43+
Builtin_variables.program
4644

4745
method program_output_variable =
48-
if Ocaml_backends.is_native host
49-
then None
50-
else Some Builtin_variables.output
46+
Some Builtin_variables.output
5147

5248
method ! reference_file env prefix =
5349
let default = tool#reference_file env prefix in

ocamltest/ocaml_tests.ml

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,46 @@ open Builtin_actions
2020
open Ocaml_actions
2121

2222
let bytecode =
23-
let opt_actions =
24-
[
25-
setup_ocamlc_opt_build_env;
26-
ocamlc_opt;
27-
check_ocamlc_opt_output;
28-
compare_bytecode_programs
29-
] in
30-
{
31-
test_name = "bytecode";
32-
test_run_by_default = true;
33-
test_actions =
34-
[
35-
setup_ocamlc_byte_build_env;
36-
ocamlc_byte;
37-
check_ocamlc_byte_output;
38-
run;
39-
check_program_output;
40-
] @ (if Ocamltest_config.arch<>"none" then opt_actions else [])
41-
}
23+
let test_actions =
24+
if Ocamltest_config.arch="none" then
25+
[
26+
setup_ocamlc_byte_build_env;
27+
ocamlc_byte;
28+
check_ocamlc_byte_output;
29+
run;
30+
check_program_output;
31+
]
32+
else
33+
[
34+
setup_ocamlc_opt_build_env;
35+
ocamlc_opt;
36+
check_ocamlc_opt_output;
37+
run;
38+
check_program_output
39+
]
40+
in
41+
{
42+
test_name = "bytecode";
43+
test_run_by_default = true;
44+
test_actions;
45+
}
4246

4347
let native =
44-
let opt_actions =
45-
[
46-
setup_ocamlopt_byte_build_env;
47-
ocamlopt_byte;
48-
check_ocamlopt_byte_output;
49-
run;
50-
check_program_output;
51-
setup_ocamlopt_opt_build_env;
52-
ocamlopt_opt;
53-
check_ocamlopt_opt_output;
54-
] in
48+
let test_actions =
49+
if not Ocamltest_config.native_compiler then [skip]
50+
else
51+
[
52+
setup_ocamlopt_opt_build_env;
53+
ocamlopt_opt;
54+
check_ocamlopt_opt_output;
55+
run;
56+
check_program_output
57+
]
58+
in
5559
{
5660
test_name = "native";
5761
test_run_by_default = true;
58-
test_actions =
59-
(if Ocamltest_config.native_compiler then opt_actions else [skip])
62+
test_actions;
6063
}
6164

6265
let toplevel = {

0 commit comments

Comments
 (0)