diff options
author | John Högberg <[email protected]> | 2018-10-08 07:50:29 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-10-08 07:50:29 +0200 |
commit | e2a1ec914d9bec9f9310669df877601eed2f808d (patch) | |
tree | 287508f59246146dceb080060a5b120f97c4cf2c /lib/stdlib/test/epp_SUITE.erl | |
parent | 3ea2ff5697d1ee53a31d7f0530692f49e9d0c516 (diff) | |
parent | 4312fba6cf15a41b7331c2309104dd82f29be9d6 (diff) | |
download | otp-e2a1ec914d9bec9f9310669df877601eed2f808d.tar.gz otp-e2a1ec914d9bec9f9310669df877601eed2f808d.tar.bz2 otp-e2a1ec914d9bec9f9310669df877601eed2f808d.zip |
Merge branch 'maint'
* maint:
compiler: Forward +source flag to epp and fix bug in +deterministic
epp: Allow user to set source name independently of input file name
Diffstat (limited to 'lib/stdlib/test/epp_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/epp_SUITE.erl | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index 10e1b75e0f..a90beed4f3 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -29,7 +29,7 @@ otp_8562/1, otp_8665/1, otp_8911/1, otp_10302/1, otp_10820/1, otp_11728/1, encoding/1, extends/1, function_macro/1, test_error/1, test_warning/1, otp_14285/1, - test_if/1]). + test_if/1,source_name/1]). -export([epp_parse_erl_form/2]). @@ -70,7 +70,7 @@ all() -> overload_mac, otp_8388, otp_8470, otp_8562, otp_8665, otp_8911, otp_10302, otp_10820, otp_11728, encoding, extends, function_macro, test_error, test_warning, - otp_14285, test_if]. + otp_14285, test_if, source_name]. groups() -> [{upcase_mac, [], [upcase_mac_1, upcase_mac_2]}, @@ -1702,6 +1702,18 @@ function_macro(Config) -> ok. +source_name(Config) when is_list(Config) -> + DataDir = proplists:get_value(data_dir, Config), + File = filename:join(DataDir, "source_name.erl"), + + source_name_1(File, "/test/gurka.erl"), + source_name_1(File, "gaffel.erl"), + + ok. + +source_name_1(File, Expected) -> + Res = epp:parse_file(File, [{source_name, Expected}]), + {ok, [{attribute,_,file,{Expected,_}} | _Forms]} = Res. check(Config, Tests) -> eval_tests(Config, fun check_test/2, Tests). |