summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2018-11-18 11:27:26 -0500
committerGitHub <noreply@github.com>2018-11-18 11:27:26 -0500
commit9c24f558721cd9e63f79e16bc623fbee78ab1739 (patch)
tree7bb1aed9bf983731c88df44dc990049002fc2e65 /test
parent62663bc0ba05992d0237a14605d2d43f1820833b (diff)
parentbeb8878a6c73d37e05a167b974d965ede005f2f8 (diff)
Merge pull request #1938 from erlang/xrl-yrl-recompile
check last modified time on erl files for xrl and yrl files before compiling
Diffstat (limited to 'test')
-rw-r--r--test/rebar_compile_SUITE.erl25
1 files changed, 19 insertions, 6 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index 6b1d791..4d51f2a 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -845,20 +845,33 @@ dont_recompile_yrl_or_xrl(Config) ->
"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"]),
+ XrlErl = filename:join([AppDir, "src", filename:basename(Xrl, ".xrl") ++ ".erl"]),
+ YrlErl = filename:join([AppDir, "src", filename:basename(Yrl, ".yrl") ++ ".erl"]),
+
+ EbinDir = filename:join([AppDir, "_build", "default", "lib", Name, "ebin"]),
+ XrlBeam = filename:join([EbinDir, filename:basename(Xrl, ".xrl") ++ ".beam"]),
+ YrlBeam = filename:join([EbinDir, filename:basename(Yrl, ".yrl") ++ ".beam"]),
rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name}]}),
- XrlModTime = filelib:last_modified(XrlBeam),
- YrlModTime = filelib:last_modified(YrlBeam),
+ XrlModTime = filelib:last_modified(XrlErl),
+ YrlModTime = filelib:last_modified(YrlErl),
+
+ XrlBeamModTime = filelib:last_modified(XrlBeam),
+ YrlBeamModTime = filelib:last_modified(YrlBeam),
timer:sleep(1000),
rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name}]}),
- NewXrlModTime = filelib:last_modified(XrlBeam),
- NewYrlModTime = filelib:last_modified(YrlBeam),
+ NewXrlModTime = filelib:last_modified(XrlErl),
+ NewYrlModTime = filelib:last_modified(YrlErl),
+
+ NewXrlBeamModTime = filelib:last_modified(XrlBeam),
+ NewYrlBeamModTime = filelib:last_modified(YrlBeam),
+
+ ?assert(XrlBeamModTime == NewXrlBeamModTime),
+ ?assert(YrlBeamModTime == NewYrlBeamModTime),
?assert(XrlModTime == NewXrlModTime),
?assert(YrlModTime == NewYrlModTime).