aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-22 19:53:49 +0200
committerLoïc Hoguin <[email protected]>2015-09-22 19:53:49 +0200
commite75301e0a2d7b11021b17a8b606a959b07497cc0 (patch)
treeb8e2e2b587b6efc9a0fb9a3b925258cf46546649 /test/core_deps.mk
parent2b1a01d8d45348bec030ed049cf4192f950c2461 (diff)
downloaderlang.mk-e75301e0a2d7b11021b17a8b606a959b07497cc0.tar.gz
erlang.mk-e75301e0a2d7b11021b17a8b606a959b07497cc0.tar.bz2
erlang.mk-e75301e0a2d7b11021b17a8b606a959b07497cc0.zip
Add a test for SHELL_DEPS
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r--test/core_deps.mk47
1 files changed, 44 insertions, 3 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 09379c1..996f4c5 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -1,6 +1,6 @@
# Core: Packages and dependencies.
-CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js doc otp pkg rel search
+CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js doc otp pkg rel search shell
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -227,12 +227,12 @@ endif
core-deps-rel: build clean-core-deps-rel
- $i "Bootstrap a new release-enabled OTP application named $(APP)"
+ $i "Bootstrap a new release-enabled OTP library named $(APP)"
$t mkdir $(APP)/
$t cp ../erlang.mk $(APP)/
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib bootstrap-rel $v
- $i "Add Recon to the list of dependencies"
+ $i "Add Recon to the list of release dependencies"
$t sed -i.bak '2i\
REL_DEPS = recon\
' $(APP)/Makefile
@@ -300,3 +300,44 @@ core-deps-search: build clean-core-deps-search
$i "Run 'make search q=cowboy' and check that it prints packages"
$t test -n "`$(MAKE) -C $(APP) search q=cowboy`"
+
+core-deps-shell: build clean-core-deps-shell
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Add TDDReloader to the list of shell dependencies"
+ $t sed -i.bak '2i\
+SHELL_DEPS = tddreloader\
+' $(APP)/Makefile
+
+ $i "Build the application and its dependencies"
+ $t $(MAKE) -C $(APP) deps app $v
+
+ $i "Check that no dependencies were fetched"
+ $t test ! -e $(APP)/deps
+
+ $i "Check that the application was compiled correctly"
+ $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ [ok = application:load(App) || App <- [$(APP)]], \
+ {ok, Deps} = application:get_key($(APP), applications), \
+ false = lists:member(tddreloader, Deps), \
+ halt()"
+
+ $i "Run the shell"
+ $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval \" \
+ ok = application:load($(APP)), \
+ ok = application:load(tddreloader), \
+ halt()\"" $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/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, Deps} = application:get_key($(APP), applications), \
+ false = lists:member(tddreloader, Deps), \
+ halt()"