aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/error_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-02-25 16:12:09 +0100
committerBjörn Gustavsson <[email protected]>2016-02-25 17:08:34 +0100
commitfc3c64711400be9eae653350213630cb8cb257f9 (patch)
tree5879360d9d690c10231f73ecc347e58c70d8628e /lib/compiler/test/error_SUITE.erl
parentbf4ae9bb9cc0b4ae53447aa4a7cd25add5d3a7a4 (diff)
downloadotp-fc3c64711400be9eae653350213630cb8cb257f9.tar.gz
otp-fc3c64711400be9eae653350213630cb8cb257f9.tar.bz2
otp-fc3c64711400be9eae653350213630cb8cb257f9.zip
Remove ?line macros
Diffstat (limited to 'lib/compiler/test/error_SUITE.erl')
-rw-r--r--lib/compiler/test/error_SUITE.erl106
1 files changed, 48 insertions, 58 deletions
diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl
index aca6884b59..dd2e766599 100644
--- a/lib/compiler/test/error_SUITE.erl
+++ b/lib/compiler/test/error_SUITE.erl
@@ -65,7 +65,7 @@ bif_clashes(Config) when is_list(Config) ->
[return_warnings],
{error,
[{4, erl_lint,{call_to_redefined_old_bif,{length,1}}}], []} }],
- ?line [] = run(Config, Ts),
+ [] = run(Config, Ts),
Ts1 = [{bif_clashes2,
<<"
-export([t/0]).
@@ -76,7 +76,7 @@ bif_clashes(Config) when is_list(Config) ->
[return_warnings],
{error,
[{3, erl_lint,{redefine_old_bif_import,{length,1}}}], []} }],
- ?line [] = run(Config, Ts1),
+ [] = run(Config, Ts1),
Ts00 = [{bif_clashes3,
<<"
-export([t/0]).
@@ -89,7 +89,7 @@ bif_clashes(Config) when is_list(Config) ->
">>,
[return_warnings],
[]}],
- ?line [] = run(Config, Ts00),
+ [] = run(Config, Ts00),
Ts11 = [{bif_clashes4,
<<"
-export([t/0]).
@@ -100,7 +100,7 @@ bif_clashes(Config) when is_list(Config) ->
">>,
[return_warnings],
[]}],
- ?line [] = run(Config, Ts11),
+ [] = run(Config, Ts11),
Ts000 = [{bif_clashes5,
<<"
-export([t/0]).
@@ -113,7 +113,7 @@ bif_clashes(Config) when is_list(Config) ->
[return_warnings],
{warning,
[{4, erl_lint,{call_to_redefined_bif,{binary_part,3}}}]} }],
- ?line [] = run(Config, Ts000),
+ [] = run(Config, Ts000),
Ts111 = [{bif_clashes6,
<<"
-export([t/0]).
@@ -124,7 +124,7 @@ bif_clashes(Config) when is_list(Config) ->
[return_warnings],
{warning,
[{3, erl_lint,{redefine_bif_import,{binary_part,3}}}]} }],
- ?line [] = run(Config, Ts111),
+ [] = run(Config, Ts111),
Ts2 = [{bif_clashes7,
<<"
-export([t/0]).
@@ -139,7 +139,7 @@ bif_clashes(Config) when is_list(Config) ->
{error,
[{7,erl_lint,{define_import,{length,1}}}],
[]} }],
- ?line [] = run2(Config, Ts2),
+ [] = run2(Config, Ts2),
Ts3 = [{bif_clashes8,
<<"
-export([t/1]).
@@ -153,7 +153,7 @@ bif_clashes(Config) when is_list(Config) ->
{error,
[{4,erl_lint,{illegal_guard_local_call,{length,1}}}],
[]} }],
- ?line [] = run2(Config, Ts3),
+ [] = run2(Config, Ts3),
Ts4 = [{bif_clashes9,
<<"
-export([t/1]).
@@ -166,7 +166,7 @@ bif_clashes(Config) when is_list(Config) ->
{error,
[{5,erl_lint,{illegal_guard_local_call,{length,1}}}],
[]} }],
- ?line [] = run2(Config, Ts4),
+ [] = run2(Config, Ts4),
ok.
@@ -175,22 +175,22 @@ bif_clashes(Config) when is_list(Config) ->
%% Tests that a head mismatch is reported on the correct line (OTP-2125).
head_mismatch_line(Config) when is_list(Config) ->
- ?line [E|_] = get_compilation_errors(Config, "head_mismatch_line"),
- ?line {26, Mod, Reason} = E,
- ?line Mod:format_error(Reason),
+ [E|_] = get_compilation_errors(Config, "head_mismatch_line"),
+ {26, Mod, Reason} = E,
+ Mod:format_error(Reason),
ok.
%% Compiles a test file and returns the list of errors.
get_compilation_errors(Config, Filename) ->
DataDir = proplists:get_value(data_dir, Config),
- ?line File = filename:join(DataDir, Filename),
- ?line {error, [{_Name, E}|_], []} = compile:file(File, [return_errors]),
+ File = filename:join(DataDir, Filename),
+ {error, [{_Name, E}|_], []} = compile:file(File, [return_errors]),
E.
warnings_as_errors(Config) when is_list(Config) ->
- ?line TestFile = test_filename(Config),
- ?line BeamFile = filename:rootname(TestFile, ".erl") ++ ".beam",
+ TestFile = test_filename(Config),
+ BeamFile = filename:rootname(TestFile, ".erl") ++ ".beam",
OutDir = proplists:get_value(priv_dir, Config),
Ts1 = [{warnings_as_errors,
@@ -203,8 +203,8 @@ warnings_as_errors(Config) when is_list(Config) ->
{error,
[],
[{3,erl_lint,{unused_var,'A'}}]} }],
- ?line [] = run(Ts1, TestFile, write_beam),
- ?line false = filelib:is_regular(BeamFile),
+ [] = run(Ts1, TestFile, write_beam),
+ false = filelib:is_regular(BeamFile),
Ts2 = [{warning_unused_var,
<<"
@@ -216,9 +216,9 @@ warnings_as_errors(Config) when is_list(Config) ->
{warning,
[{3,erl_lint,{unused_var,'A'}}]} }],
- ?line [] = run(Ts2, TestFile, write_beam),
- ?line true = filelib:is_regular(BeamFile),
- ?line ok = file:delete(BeamFile),
+ [] = run(Ts2, TestFile, write_beam),
+ true = filelib:is_regular(BeamFile),
+ ok = file:delete(BeamFile),
ok.
@@ -295,7 +295,7 @@ bad_utf8(Config) ->
run(Config, Tests) ->
- ?line File = test_filename(Config),
+ File = test_filename(Config),
run(Tests, File, dont_write_beam).
run(Tests, File, WriteBeam) ->
@@ -312,7 +312,7 @@ run(Tests, File, WriteBeam) ->
lists:foldl(F, [], Tests).
run2(Config, Tests) ->
- ?line File = test_filename(Config),
+ File = test_filename(Config),
run2(Tests, File, dont_write_beam).
run2(Tests, File, WriteBeam) ->
@@ -345,46 +345,36 @@ run_test(Test0, File, Warnings, WriteBeam) ->
ModName = filename:rootname(filename:basename(File), ".erl"),
Mod = list_to_atom(ModName),
Test = ["-module(",ModName,"). ",Test0],
- ?line Opts = case WriteBeam of
- dont_write_beam ->
- [binary,return_errors|Warnings];
- write_beam ->
- [return_errors|Warnings]
- end,
- ?line ok = file:write_file(File, Test),
+ Opts = case WriteBeam of
+ dont_write_beam ->
+ [binary,return_errors|Warnings];
+ write_beam ->
+ [return_errors|Warnings]
+ end,
+ ok = file:write_file(File, Test),
%% Compile once just to print all errors and warnings.
- ?line compile:file(File, [binary,report|Warnings]),
+ compile:file(File, [binary,report|Warnings]),
%% Test result of compilation.
io:format("~p\n", [Opts]),
- ?line Res = case compile:file(File, Opts) of
- {ok,Mod,_,[{_File,Ws}]} ->
- %io:format("compile:file(~s,~p) ->~n~p~n",
- % [File,Opts,Ws]),
- {warning,Ws};
- {ok,Mod,_,[]} ->
- %io:format("compile:file(~s,~p) ->~n~p~n",
- % [File,Opts,Ws]),
- [];
- {ok,Mod,[{_File,Ws}]} ->
- {warning,Ws};
- {ok,Mod,[]} ->
- [];
- {error,[{XFile,Es}],Ws} = _ZZ when is_list(XFile) ->
- %io:format("compile:file(~s,~p) ->~n~p~n",
- % [File,Opts,_ZZ]),
- {error,Es,Ws};
- {error,[{XFile,Es1},{XFile,Es2}],Ws} = _ZZ
- when is_list(XFile) ->
- %io:format("compile:file(~s,~p) ->~n~p~n",
- % [File,Opts,_ZZ]),
- {error,Es1++Es2,Ws};
- {error,Es,[{_File,Ws}]} = _ZZ->
- %io:format("compile:file(~s,~p) ->~n~p~n",
- % [File,Opts,_ZZ]),
- {error,Es,Ws}
- end,
+ Res = case compile:file(File, Opts) of
+ {ok,Mod,_,[{_File,Ws}]} ->
+ {warning,Ws};
+ {ok,Mod,_,[]} ->
+ [];
+ {ok,Mod,[{_File,Ws}]} ->
+ {warning,Ws};
+ {ok,Mod,[]} ->
+ [];
+ {error,[{XFile,Es}],Ws} = _ZZ when is_list(XFile) ->
+ {error,Es,Ws};
+ {error,[{XFile,Es1},{XFile,Es2}],Ws} = _ZZ
+ when is_list(XFile) ->
+ {error,Es1++Es2,Ws};
+ {error,Es,[{_File,Ws}]} = _ZZ->
+ {error,Es,Ws}
+ end,
file:delete(File),
Res.