aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/compilation_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-11 08:23:36 +0100
committerBjörn Gustavsson <[email protected]>2012-01-11 08:23:36 +0100
commitbb312f5fb5748fef90f57ccb387f1c32a729f086 (patch)
tree18a43561160eba91005cf3f34c6c211ed3bc8c98 /lib/compiler/test/compilation_SUITE.erl
parent3ee63ae7b498a1d7d232b0dcdcffb7f7f30c9579 (diff)
parent3a6963f4f79adf75adc098a8e7e5ed7ac5fff46b (diff)
downloadotp-bb312f5fb5748fef90f57ccb387f1c32a729f086.tar.gz
otp-bb312f5fb5748fef90f57ccb387f1c32a729f086.tar.bz2
otp-bb312f5fb5748fef90f57ccb387f1c32a729f086.zip
Merge branch 'bjorn/compiler/tests' into maint
* bjorn/compiler/tests: compile_SUITE: Add test of 'sys_pre_attributes' Correct syntax in compiler.cover Cover v3_kernel:get_line/1 core_SUITE: Cover the nomatch_shadow warning in v3_kernel core_SUITE: Cover v3_kernel:build_match/2 bs_match_SUITE: Add a test case to cover bsm_ensure_no_partition_2/5 core_fold_SUITE: Cover sys_core_fold:is_safe_bool_expr_1/3 core_SUITE: Cover sys_core_fold:eval_is_boolean/2 core_SUITE: Cover sys_core_fold:make_effect_seq/2 beam_validator_SUITE:beam_files/1: Validate modules in parallel compilation_SUITE: Compile compiler modules in parallel compilation_SUITE: Prevent cover from being run on slave nodes test_lib:p_run/2: Be careful about how many parallel processes we use Remove part_eval_SUITE
Diffstat (limited to 'lib/compiler/test/compilation_SUITE.erl')
-rw-r--r--lib/compiler/test/compilation_SUITE.erl32
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl
index 1f17664b54..664582a3a8 100644
--- a/lib/compiler/test/compilation_SUITE.erl
+++ b/lib/compiler/test/compilation_SUITE.erl
@@ -427,9 +427,9 @@ self_compile_1(Config, Prefix, Opts) ->
%% Compile the compiler again using the newly compiled compiler.
%% (In another node because reloading the compiler would disturb cover.)
CompilerB = Prefix++"compiler_b",
- ?line CompB = make_compiler_dir(Priv, Prefix++"compiler_b"),
+ CompB = make_compiler_dir(Priv, CompilerB),
?line VsnB = VsnA ++ ".0",
- ?line self_compile_node(CompilerB, CompA, CompB, VsnB, Opts),
+ self_compile_node(CompA, CompB, VsnB, Opts),
%% Compare compiler directories.
?line compare_compilers(CompA, CompB),
@@ -438,21 +438,26 @@ self_compile_1(Config, Prefix, Opts) ->
?line CompilerC = Prefix++"compiler_c",
?line CompC = make_compiler_dir(Priv, CompilerC),
?line VsnC = VsnB ++ ".0",
- ?line self_compile_node(CompilerC, CompB, CompC, VsnC, Opts),
+ self_compile_node(CompB, CompC, VsnC, Opts),
?line compare_compilers(CompB, CompC),
?line test_server:timetrap_cancel(Dog),
ok.
-self_compile_node(NodeName0, CompilerDir, OutDir, Version, Opts) ->
- ?line NodeName = list_to_atom(NodeName0),
- ?line Dog = test_server:timetrap(test_server:minutes(10)),
+self_compile_node(CompilerDir, OutDir, Version, Opts) ->
+ ?line Dog = test_server:timetrap(test_server:minutes(15)),
?line Pa = "-pa " ++ filename:dirname(code:which(?MODULE)) ++
" -pa " ++ CompilerDir,
- ?line {ok,Node} = start_node(NodeName, Pa),
?line Files = compiler_src(),
- ?line ok = rpc:call(Node, ?MODULE, compile_compiler, [Files,OutDir,Version,Opts]),
- ?line test_server:stop_node(Node),
+
+ %% We don't want the cover server started on the other node,
+ %% because it will load the same cover-compiled code as on this
+ %% node. Use a shielded node to prevent the cover server from
+ %% being started.
+ ?t:run_on_shielded_node(
+ fun() ->
+ compile_compiler(Files, OutDir, Version, Opts)
+ end, Pa),
?line test_server:timetrap_cancel(Dog),
ok.
@@ -465,9 +470,12 @@ compile_compiler(Files, OutDir, Version, InlineOpts) ->
{d,'COMPILER_VSN',"\""++Version++"\""},
nowarn_shadow_vars,
{i,filename:join(code:lib_dir(stdlib), "include")}|InlineOpts],
- lists:foreach(fun(File) ->
- {ok,_} = compile:file(File, Opts)
- end, Files).
+ test_lib:p_run(fun(File) ->
+ case compile:file(File, Opts) of
+ {ok,_} -> ok;
+ _ -> error
+ end
+ end, Files).
compiler_src() ->
filelib:wildcard(filename:join([code:lib_dir(compiler), "src", "*.erl"])).