aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-23 18:56:35 +0200
committerLoïc Hoguin <[email protected]>2015-09-23 18:56:35 +0200
commit87e4453d0f2ca2192021d6f389e3c4b83fa165fe (patch)
tree0704b3ca6fb05c9f0349157cee14beb3dd0dafab /test/core_deps.mk
parent5cf5df307974a47597b730d4bbcb4195a2dd1c81 (diff)
downloaderlang.mk-87e4453d0f2ca2192021d6f389e3c4b83fa165fe.tar.gz
erlang.mk-87e4453d0f2ca2192021d6f389e3c4b83fa165fe.tar.bz2
erlang.mk-87e4453d0f2ca2192021d6f389e3c4b83fa165fe.zip
Add a test for dep_$(DEP) variables
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r--test/core_deps.mk37
1 files changed, 36 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 7190c8b..4657bc5 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 dep-commit doc otp pkg rel search shell test
+CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js dep-commit dep-full doc otp pkg rel search shell test
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -160,6 +160,41 @@ endif
{ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
halt()"
+core-deps-dep-full: build clean-core-deps-dep-full
+
+ $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 Cowboy 1.0.0 to the list of dependencies"
+ $t sed -i.bak '2i\
+DEPS = cowboy\
+dep_cowboy = git https://github.com/ninenines/cowboy 1.0.0\
+' $(APP)/Makefile
+
+ifdef LEGACY
+ $i "Add Cowboy to the applications key in the .app.src file"
+ $t sed -i.bak '8i\
+ cowboy,' $(APP)/src/$(APP).app.src
+endif
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/deps/cowboy
+ $t test -d $(APP)/deps/cowlib
+ $t test -d $(APP)/deps/ranch
+
+ $i "Check that the application was compiled correctly"
+ $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
+ {ok, Deps} = application:get_key($(APP), applications), \
+ true = lists:member(cowboy, Deps), \
+ {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
+ halt()"
+
core-deps-doc: build clean-core-deps-doc
$i "Bootstrap a new OTP library named $(APP)"