From 608f6a85ad68a7bbd9140fcd0258161689612df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 24 Sep 2015 17:46:32 +0200 Subject: Add tests for IGNORE_DEPS Fix IGNORE_DEPS not being propagated downward. Fix IGNORE_DEPS handling with autopatched Rebar projects, where the user defined value was overriden with the one from autopatching. --- test/core_deps.mk | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/core_deps.mk b/test/core_deps.mk index bac2cf7..da801f4 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 fetch-cp fetch-custom fetch-fail-bad fetch-fail-unknown fetch-git fetch-hex fetch-hg fetch-legacy fetch-svn order-first order-top otp pkg rel search shell test +CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js dep-commit doc fetch-cp fetch-custom fetch-fail-bad fetch-fail-unknown fetch-git fetch-hex fetch-hg fetch-legacy fetch-svn ignore order-first order-top otp pkg rel search shell test CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES)) CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS)) @@ -457,6 +457,40 @@ endif {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \ halt()" +core-deps-ignore: build clean-core-deps-ignore + + $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 dependencies, Ranch to the ignore list and to test dependencies" + $t sed -i.bak '2i\ +DEPS = cowboy\ +IGNORE_DEPS = ranch\ +TEST_DEPS = ranch\ +' $(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 the correct dependencies were fetched" + $t test -d $(APP)/deps/cowboy + $t test -d $(APP)/deps/cowlib + $t test ! -e $(APP)/deps/ranch + + $i "Build the test dependencies" + $t $(MAKE) -C $(APP) test-deps $v + + $i "Check that the correct dependencies were fetched" + $t test -d $(APP)/deps/ranch + # A lower-level dependency of the first dependency always # wins over a lower-level dependency of the second dependency. core-deps-order-first: build clean-core-deps-order-first -- cgit v1.2.3