Skip to content

Commit

Permalink
DEBUG: Try to figure out which step that is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
frej committed Jul 31, 2024
1 parent b75022e commit ed7bfc1
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions lib/compiler/test/compilation_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,13 @@ compile_load(Module, Dir, Conf) ->
ok.

self_compile(Config) when is_list(Config) ->
ct:pal(?HI_IMPORTANCE, "Starting self_compile~n"),
self_compile_1(Config, "new", [inline]).

self_compile_old_inliner(Config) when is_list(Config) ->
%% The old inliner is useful for testing that sys_core_fold does not
%% introduce name capture problems.
ct:pal(?HI_IMPORTANCE, "Starting self_compile_old_inliner~n"),
self_compile_1(Config, "old", [verbose,{inline,500}]).

self_compile_1(Config, Prefix, Opts) ->
Expand All @@ -328,15 +330,17 @@ self_compile_1(Config, Prefix, Opts) ->
%% Compile the compiler. (In this node to get better coverage.)
CompA = make_compiler_dir(Priv, Prefix++"compiler_a"),
VsnA = Version ++ ".0",
ct:pal(?HI_IMPORTANCE, "self_compile_1: 0~n"),
compile_compiler(compiler_src(), CompA, VsnA, Opts),

ct:pal(?HI_IMPORTANCE, "self_compile_1: 1~n"),
%% Compile the compiler again using the newly compiled compiler.
%% (In another node because reloading the compiler would disturb cover.)
CompilerB = Prefix++"compiler_b",
CompB = make_compiler_dir(Priv, CompilerB),
VsnB = VsnA ++ ".0",
ct:pal(?HI_IMPORTANCE, "self_compile_1: 2~n"),
self_compile_node(CompA, CompB, VsnB, Opts),

ct:pal(?HI_IMPORTANCE, "self_compile_1: 3~n"),
%% Compare compiler directories. The compiler directories should
%% be equal (except for beam_asm that contains the compiler version).
compare_compilers(CompA, CompB),
Expand Down Expand Up @@ -364,17 +368,30 @@ compile_compiler(Files, OutDir, Version, InlineOpts) ->
io:format("~ts", [code:which(compile)]),
io:format("Compiling ~s into ~ts", [Version,OutDir]),
Opts = [report,
return_errors,
clint0,clint,ssalint,
bin_opt_info,
recv_opt_info,
{outdir,OutDir},
{d,'COMPILER_VSN',"\""++Version++"\""},
nowarn_shadow_vars,
{i,filename:join(code:lib_dir(stdlib), "include")}|InlineOpts],
lists:foreach(fun(F) ->
ct:pal(?HI_IMPORTANCE, "!! will compile ~p~n", [F])
end, Files),
ct:pal(?HI_IMPORTANCE,
"!! ~p: errors: ~p~nwarnings: ~p~n",
[File, Es, Ws]),
test_lib:p_run(fun(File) ->
case compile:file(File, Opts) of
{ok,_} -> ok;
_ -> error
{ok,_} ->
ok;
{errro,Es,Ws} ->
ct:pal(?HI_IMPORTANCE,
"!! ~p: errors: ~p~nwarnings: ~p~n",
[File, Es, Ws]),

error
end
end, Files).

Expand Down

0 comments on commit ed7bfc1

Please sign in to comment.