aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/error_SUITE.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2015-03-25 13:59:26 +0100
committerAnthony Ramine <[email protected]>2015-03-26 12:13:30 +0100
commitd8fa79149a1339b2359ecc981f992bd53e5a9d18 (patch)
tree51f62da658ea6699454f6577c53521e3ebf8c68b /lib/compiler/test/error_SUITE.erl
parent07abc92d5c763cee81bf69695e35a658ddc961dc (diff)
downloadotp-d8fa79149a1339b2359ecc981f992bd53e5a9d18.tar.gz
otp-d8fa79149a1339b2359ecc981f992bd53e5a9d18.tar.bz2
otp-d8fa79149a1339b2359ecc981f992bd53e5a9d18.zip
Properly report unknown parse transforms
We don't want undef errors coming from the parse transform itself to be confused with undef errors caused by the absence of the parse transform. Reported-by: Klas Johansson
Diffstat (limited to 'lib/compiler/test/error_SUITE.erl')
-rw-r--r--lib/compiler/test/error_SUITE.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl
index bd877bb528..8e79b88821 100644
--- a/lib/compiler/test/error_SUITE.erl
+++ b/lib/compiler/test/error_SUITE.erl
@@ -235,10 +235,18 @@ transforms(Config) ->
">>,
{error,[{none,compile,{parse_transform,?MODULE,{too_bad,_}}}],[]} =
run_test(Ts2, test_filename(Config), [], dont_write_beam),
+ Ts3 = <<"
+ -compile({parse_transform,",?MODULE_STRING,"}).
+ ">>,
+ {error,[{none,compile,{parse_transform,?MODULE,{undef,_}}}],[]} =
+ run_test(Ts3, test_filename(Config), [call_undef], dont_write_beam),
ok.
-parse_transform(_, _) ->
- error(too_bad).
+parse_transform(_, Opts) ->
+ case lists:member(call_undef, Opts) of
+ false -> error(too_bad);
+ true -> camembert:délicieux()
+ end.
forbidden_maps(Config) when is_list(Config) ->