aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-26 14:41:56 +0200
committerLoïc Hoguin <[email protected]>2015-09-26 14:41:56 +0200
commit0f78319fd528236a0fd7d152870e77248cfc5891 (patch)
tree05452461c84f7acd477525ea759570b1a7a6ed08 /test/core_deps.mk
parentc1131f4f7420d009c8a05e5de9dd0888127aa0aa (diff)
downloaderlang.mk-0f78319fd528236a0fd7d152870e77248cfc5891.tar.gz
erlang.mk-0f78319fd528236a0fd7d152870e77248cfc5891.tar.bz2
erlang.mk-0f78319fd528236a0fd7d152870e77248cfc5891.zip
Make tests work on more systems
Some systems do not have subsecond file modification detection capabilities. This is the case in OSX because the HFS+ file system has 1 second resolution. This is also the case in other OSes with particular file systems or even shells. For example, the "test" command in Bash does not support subsecond file times, while the ZSH one and the /usr/bin/test on my machine does. On those systems, with Bash, find -newer will work, but not test -nt. Tests were updated to reflect this. The test Makefile runs a series of commands to determine if subsecond resolution is available. When it is not, a sleep command will be executed before relevant operations in the tests. Because the Bash shell is often the default shell for Make, and because users of ZSH may want to avoid sleeping for no reasons, a new variable was introduced: ZSH=1. When provided when running tests, the shell will be switched to ZSH, and subsecond resolution will work as expected. Tests have been fixed to work with ZSH as well. All this only applies to tests, Erlang.mk itself is so far not affected by this issue.
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r--test/core_deps.mk24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 3d01eb7..a75e655 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -37,7 +37,7 @@ dep_8cc = git https://github.com/rui314/8cc master\
$t $(APP)/deps/8cc/8cc -h $v
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member('8cc', Deps), \
@@ -68,7 +68,7 @@ dep_imagejs = git https://github.com/jklmnn/imagejs master\
$t test -f $(APP)/deps/imagejs/Makefile.bmp
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(imagejs, Deps), \
@@ -119,7 +119,7 @@ dep_jquery = git https://github.com/jquery/jquery master\
$t test -d $(APP)/deps/jquery
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(jquery, Deps), \
@@ -218,7 +218,7 @@ EDOC_OPTS = {doclet, edown_doclet}\
$t test ! -e $(APP)/deps
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(edown, Deps), \
@@ -282,7 +282,7 @@ core-deps-fetch-custom: build clean-core-deps-fetch-custom
$t sed -i.bak '2i\
DEPS = boop\
dep_boop = beep boop\
-dep_fetch_beep = mkdir -p \$$(DEPS_DIR)/\$$1\
+dep_fetch_beep = mkdir -p \$$(DEPS_DIR)/\$$1/ebin/\
' $(APP)/Makefile
ifdef LEGACY
@@ -631,7 +631,7 @@ OTP_DEPS = crypto\
$t test ! -e $(APP)/deps
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP), crypto]], \
{ok, Deps} = application:get_key($(APP), applications), \
true = lists:member(crypto, Deps), \
@@ -698,7 +698,7 @@ REL_DEPS = recon\
$t test ! -e $(APP)/deps
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(recon, Deps), \
@@ -712,7 +712,7 @@ REL_DEPS = recon\
$i "Check that the application was compiled correctly"
$t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
+ [ok = application:load(App) || App <- [$(APP), recon]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(recon, Deps), \
halt()"
@@ -766,7 +766,7 @@ SHELL_DEPS = tddreloader\
$t test ! -e $(APP)/deps
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(tddreloader, Deps), \
@@ -783,7 +783,7 @@ SHELL_DEPS = tddreloader\
$i "Check that the application was compiled correctly"
$t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
+ [ok = application:load(App) || App <- [$(APP), tddreloader]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(tddreloader, Deps), \
halt()"
@@ -811,7 +811,7 @@ TEST_DEPS = triq\
$t test ! -e $(APP)/deps
$i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
[ok = application:load(App) || App <- [$(APP)]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(triq, Deps), \
@@ -825,7 +825,7 @@ TEST_DEPS = triq\
$i "Check that the application was compiled correctly"
$t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
+ [ok = application:load(App) || App <- [$(APP), triq]], \
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(triq, Deps), \
halt()"