diff options
author | Tristan Sloughter <t@crashfast.com> | 2018-10-06 18:52:20 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-06 18:52:20 -0600 |
commit | 763fd05a0f6be023a4f646c55ddd72ae193e350b (patch) | |
tree | d785184b18bcee2b83e527d7a72ec0f60c4d3cc4 /test | |
parent | 4d92f3c040680213127fc3faa9638e1cd34b50fa (diff) |
fix yrl compiler and add test (#1906)
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_compile_SUITE.erl | 23 |
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), |