summaryrefslogtreecommitdiff
path: root/test/rebar_compile_SUITE.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2018-10-06 18:52:20 -0600
committerGitHub <noreply@github.com>2018-10-06 18:52:20 -0600
commit763fd05a0f6be023a4f646c55ddd72ae193e350b (patch)
treed785184b18bcee2b83e527d7a72ec0f60c4d3cc4 /test/rebar_compile_SUITE.erl
parent4d92f3c040680213127fc3faa9638e1cd34b50fa (diff)
fix yrl compiler and add test (#1906)
Diffstat (limited to 'test/rebar_compile_SUITE.erl')
-rw-r--r--test/rebar_compile_SUITE.erl23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index e97b5fb..867460c 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -832,19 +832,36 @@ dont_recompile_yrl_or_xrl(Config) ->
"Erlang code.",
ok = ec_file:write(Xrl, XrlBody),
+ Yrl = filename:join([AppDir, "src", "not_a_real_yrl_" ++ Name ++ ".yrl"]),
+ ok = filelib:ensure_dir(Yrl),
+ YrlBody = ["Nonterminals E T F.\n"
+ "Terminals '+' '*' '(' ')' number.\n"
+ "Rootsymbol E.\n"
+ "E -> E '+' T: {'$2', '$1', '$3'}.\n"
+ "E -> T : '$1'.\n"
+ "T -> T '*' F: {'$2', '$1', '$3'}.\n"
+ "T -> F : '$1'.\n"
+ "F -> '(' E ')' : '$2'.\n"
+ "F -> number : '$1'.\n"],
+ ok = ec_file:write(Yrl, YrlBody),
+
XrlBeam = filename:join([AppDir, "ebin", filename:basename(Xrl, ".xrl") ++ ".beam"]),
+ YrlBeam = filename:join([AppDir, "ebin", filename:basename(Yrl, ".yrl") ++ ".beam"]),
rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name}]}),
- ModTime = filelib:last_modified(XrlBeam),
+ XrlModTime = filelib:last_modified(XrlBeam),
+ YrlModTime = filelib:last_modified(YrlBeam),
timer:sleep(1000),
rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name}]}),
- NewModTime = filelib:last_modified(XrlBeam),
+ NewXrlModTime = filelib:last_modified(XrlBeam),
+ NewYrlModTime = filelib:last_modified(YrlBeam),
- ?assert(ModTime == NewModTime).
+ ?assert(XrlModTime == NewXrlModTime),
+ ?assert(YrlModTime == NewYrlModTime).
delete_beam_if_source_deleted(Config) ->
AppDir = ?config(apps, Config),