aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/erl_pp_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-09-02 14:13:18 +0200
committerBjörn Gustavsson <[email protected]>2016-09-02 14:13:18 +0200
commit61b53af84200b52a5b91c4266e91ebc6ba0173ee (patch)
tree2d28327d41a41375a9258fa64d99bc3bd8d9c518 /lib/stdlib/test/erl_pp_SUITE.erl
parent49381b90620e88bda2d3f3edce25c8e841ded9c1 (diff)
parent6ba91ac62a8cffd9ea274ce8b9023abbcb8d9b67 (diff)
downloadotp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.tar.gz
otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.tar.bz2
otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.zip
Merge branch 'bjorn/eliminate-sys_pre_expand/OTP-13856'
* bjorn/eliminate-sys_pre_expand/OTP-13856: Remove sys_pre_expand xref: Eliminate use of sys_pre_expand debugger: Eliminate use of sys_pre_expand compiler: Eliminate use of sys_pre_expand shell_SUITE: Eliminate references to sys_pre_expand in comments qlc_pt: Simplify code because of updated erl_expand_records Teach erl_expand_records to translate module-less calls erl_internal: Add add_predefined_functions/1 cover: Remove always stale comment
Diffstat (limited to 'lib/stdlib/test/erl_pp_SUITE.erl')
-rw-r--r--lib/stdlib/test/erl_pp_SUITE.erl20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl
index a103f6dc53..13c5662741 100644
--- a/lib/stdlib/test/erl_pp_SUITE.erl
+++ b/lib/stdlib/test/erl_pp_SUITE.erl
@@ -1166,19 +1166,21 @@ compile(Config, Tests) ->
lists:foldl(F, [], Tests).
compile_file(Config, Test0) ->
- case compile_file(Config, Test0, ['E']) of
+ Test = ["-module(erl_pp_test).\n",
+ "-compile(export_all).\n",
+ Test0],
+ case compile_file(Config, Test, ['E']) of
{ok, RootFile} ->
File = RootFile ++ ".E",
{ok, Bin0} = file:read_file(File),
- Bin = strip_module_info(Bin0),
%% A very simple check: just try to compile the output.
- case compile_file(Config, Bin, []) of
+ case compile_file(Config, Bin0, []) of
{ok, RootFile2} ->
File2 = RootFile2 ++ ".E",
{ok, Bin1} = file:read_file(File2),
case Bin0 =:= Bin1 of
true ->
- test_max_line(binary_to_list(Bin));
+ test_max_line(binary_to_list(Bin0));
false ->
{error, file_contents_modified, {Bin0, Bin1}}
end;
@@ -1189,11 +1191,8 @@ compile_file(Config, Test0) ->
Error
end.
-compile_file(Config, Test0, Opts0) ->
+compile_file(Config, Test, Opts0) ->
FileName = filename('erl_pp_test.erl', Config),
- Test = list_to_binary(["-module(erl_pp_test). "
- "-compile(export_all). ",
- Test0]),
Opts = [export_all,return,nowarn_unused_record,{outdir,?privdir} | Opts0],
ok = file:write_file(FileName, Test),
case compile:file(FileName, Opts) of
@@ -1202,11 +1201,6 @@ compile_file(Config, Test0, Opts0) ->
Error -> Error
end.
-strip_module_info(Bin) ->
- {match, [{Start,_Len}|_]} = re:run(Bin, "module_info"),
- <<R:Start/binary,_/binary>> = Bin,
- R.
-
flat_expr1(Expr0) ->
Expr = erl_parse:new_anno(Expr0),
lists:flatten(erl_pp:expr(Expr)).