aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-22 20:00:07 +0200
committerLoïc Hoguin <[email protected]>2015-09-22 20:00:07 +0200
commitb60900f47650edbeb575ba2740db48e99afbbd30 (patch)
tree65a33d713fbaee54f7bda2fec462adaed53e8f5b /test/core_deps.mk
parente75301e0a2d7b11021b17a8b606a959b07497cc0 (diff)
downloaderlang.mk-b60900f47650edbeb575ba2740db48e99afbbd30.tar.gz
erlang.mk-b60900f47650edbeb575ba2740db48e99afbbd30.tar.bz2
erlang.mk-b60900f47650edbeb575ba2740db48e99afbbd30.zip
Add tests for TEST_DEPS
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r--test/core_deps.mk44
1 files changed, 43 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 996f4c5..c9862ed 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 shell
+CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js 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))
@@ -341,3 +341,45 @@ SHELL_DEPS = tddreloader\
{ok, Deps} = application:get_key($(APP), applications), \
false = lists:member(tddreloader, Deps), \
halt()"
+
+core-deps-test: build clean-core-deps-test
+
+ $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 "Generate .erl files"
+ $t echo "-module(boy)." > $(APP)/src/boy.erl
+ $t echo "-module(girl)." > $(APP)/src/girl.erl
+
+ $i "Add triq to the list of test dependencies"
+ $t sed -i.bak '2i\
+TEST_DEPS = triq\
+' $(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(triq, Deps), \
+ halt()"
+
+ $i "Run tests"
+ $t $(MAKE) -C $(APP) tests $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/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, Deps} = application:get_key($(APP), applications), \
+ false = lists:member(triq, Deps), \
+ halt()"