aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-29 18:49:00 +0200
committerLoïc Hoguin <[email protected]>2015-09-29 18:49:00 +0200
commitab30e05396a0704e975f3539071d677e38e011ec (patch)
tree9bc7c486e0faae065bd786527ce6202805530515
parent7cac447fb151e57c49660a76a6eb4ccca019ff58 (diff)
downloaderlang.mk-ab30e05396a0704e975f3539071d677e38e011ec.tar.gz
erlang.mk-ab30e05396a0704e975f3539071d677e38e011ec.tar.bz2
erlang.mk-ab30e05396a0704e975f3539071d677e38e011ec.zip
Add a test for SKIP_DEPS
Also don't delete DEPS_DIR if SKIP_DEPS is set.
-rw-r--r--core/deps.mk2
-rw-r--r--test/core_deps.mk39
2 files changed, 40 insertions, 1 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 8bc7b44..18ae0f8 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -605,10 +605,12 @@ distclean-apps:
done
endif
+ifndef SKIP_DEPS
distclean:: distclean-deps
distclean-deps:
$(gen_verbose) rm -rf $(DEPS_DIR)
+endif
# External plugins.
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 5b928f1..21dd5c6 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -1,6 +1,6 @@
# Core: Packages and dependencies.
-CORE_DEPS_CASES = apps apps-conflict apps-deep-conflict apps-dir apps-new-app apps-new-lib apps-new-tpl apps-only build-c-8cc build-c-imagejs build-erl build-js dep-commit dir doc fetch-cp fetch-custom fetch-fail-bad fetch-fail-unknown fetch-git fetch-hex fetch-hg fetch-legacy fetch-svn ignore no-autopatch no-autopatch-erlang-mk no-autopatch-rebar order-first order-top otp pkg rel search shell test
+CORE_DEPS_CASES = apps apps-conflict apps-deep-conflict apps-dir apps-new-app apps-new-lib apps-new-tpl apps-only build-c-8cc build-c-imagejs build-erl build-js dep-commit dir doc fetch-cp fetch-custom fetch-fail-bad fetch-fail-unknown fetch-git fetch-hex fetch-hg fetch-legacy fetch-svn ignore no-autopatch no-autopatch-erlang-mk no-autopatch-rebar order-first order-top otp pkg rel search shell skip test
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -1137,6 +1137,43 @@ core-deps-shell: build clean-core-deps-shell
false = lists:member(tddreloader, Deps), \
halt()"
+core-deps-skip: build clean-core-deps-skip
+
+ $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 to the list of dependencies"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
+
+ifdef LEGACY
+ $i "Add Cowboy to the applications key in the .app.src file"
+ $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
+endif
+
+ $i "Build the application with SKIP_DEPS=1"
+ $t $(MAKE) -C $(APP) SKIP_DEPS=1 $v
+
+ $i "Check that no dependencies were fetched"
+ $t test ! -e $(APP)/deps
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/deps/cowlib
+ $t test -d $(APP)/deps/cowboy
+ $t test -d $(APP)/deps/ranch
+
+ $i "Distclean with SKIP_DEPS=1"
+ $t $(MAKE) -C $(APP) distclean SKIP_DEPS=1 $v
+
+ $i "Check that no dependencies were removed"
+ $t test -d $(APP)/deps/cowlib
+ $t test -d $(APP)/deps/cowboy
+ $t test -d $(APP)/deps/ranch
+
core-deps-test: build clean-core-deps-test
$i "Bootstrap a new OTP library named $(APP)"