aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-22 14:20:05 +0200
committerLoïc Hoguin <[email protected]>2015-09-22 14:20:05 +0200
commit6811c6505015fafdae3cb2d110fb1c2b8c39209f (patch)
tree477ac51331b915c42670aca6485855b468bae2c1
parentb6163897dbcde398d9f76db9935b25d04841d673 (diff)
downloaderlang.mk-6811c6505015fafdae3cb2d110fb1c2b8c39209f.tar.gz
erlang.mk-6811c6505015fafdae3cb2d110fb1c2b8c39209f.tar.bz2
erlang.mk-6811c6505015fafdae3cb2d110fb1c2b8c39209f.zip
Add test for OTP_DEPS
-rw-r--r--test/core_deps.mk29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 6ec896f..5439563 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 pkg search
+CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js doc otp pkg search
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -165,6 +165,33 @@ EDOC_OPTS = {doclet, edown_doclet}\
$t test -f $(APP)/doc/boy.md
$t test -f $(APP)/doc/girl.md
+ifndef LEGACY
+core-deps-otp: build clean-core-deps-otp
+
+ $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 Crypto to the list of OTP dependencies"
+ $t sed -i.bak '2i\
+OTP_DEPS = crypto\
+' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(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), crypto]], \
+ {ok, Deps} = application:get_key($(APP), applications), \
+ true = lists:member(crypto, Deps), \
+ halt()"
+endif
+
core-deps-pkg: build clean-core-deps-pkg
$i "Bootstrap a new OTP library named $(APP)"