aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-06-08 11:55:06 +0200
committerBjörn Gustavsson <[email protected]>2016-06-08 11:55:06 +0200
commite7588998f05f92f1056e4259452f8a8363d732b5 (patch)
tree727f60cd8871f46f61fa7e90c844ddb4603eda60 /lib/compiler/test
parent55e96edb7bbb849fafaf628119fc2db9dea22e1e (diff)
parentd567a443e1b3506fdef7d1f57af8d4cd364d45b4 (diff)
downloadotp-e7588998f05f92f1056e4259452f8a8363d732b5.tar.gz
otp-e7588998f05f92f1056e4259452f8a8363d732b5.tar.bz2
otp-e7588998f05f92f1056e4259452f8a8363d732b5.zip
Merge branch 'talentdeficit/compiler/env_compiler_options/PR-1091/OTP-13654'
* talentdeficit/compiler/env_compiler_options/PR-1091/OTP-13654: compile.xml: Eliminate unsightly space before period Compiler: new function env_compiler_options/0
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/compile_SUITE.erl22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index a15efc2a00..b0148f7103 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -34,7 +34,7 @@
cover/1, env/1, core/1,
core_roundtrip/1, asm/1,
sys_pre_attributes/1, dialyzer/1,
- warnings/1, pre_load_check/1
+ warnings/1, pre_load_check/1, env_compiler_options/1
]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -50,7 +50,8 @@ all() ->
other_output, encrypted_abstr,
strict_record,
cover, env, core, core_roundtrip, asm,
- sys_pre_attributes, dialyzer, warnings, pre_load_check].
+ sys_pre_attributes, dialyzer, warnings, pre_load_check,
+ env_compiler_options].
groups() ->
[].
@@ -1092,6 +1093,23 @@ compiler_modules() ->
FN = filename,
[list_to_atom(FN:rootname(FN:basename(M), ".beam")) || M <- Ms].
+%% Test that ERL_COMPILER_OPTIONS are correctly retrieved
+%% by env_compiler_options/0
+
+env_compiler_options(_Config) ->
+ Cases = [
+ {"bin_opt_info", [bin_opt_info]},
+ {"'S'", ['S']},
+ {"{source, \"test.erl\"}", [{source, "test.erl"}]},
+ {"[{d,macro_one,1},{d,macro_two}]", [{d, macro_one, 1}, {d, macro_two}]},
+ {"[warn_export_all, warn_export_vars]", [warn_export_all, warn_export_vars]}
+ ],
+ F = fun({Env, Expected}) ->
+ true = os:putenv("ERL_COMPILER_OPTIONS", Env),
+ Expected = compile:env_compiler_options()
+ end,
+ lists:foreach(F, Cases).
+
%%%
%%% Utilities.
%%%