From 5ae1d353471fd2da01924d9a3ed9872678b49887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 26 Oct 2015 15:21:11 +0100 Subject: deps.mk: In dep_target, call dep_autopatch during the second eval ... not the first. dep_autopatch can be an expensive macro, in particular because it executes Erlang. So if NO_AUTOPATCH is set, it's best to avoid calling dep_autopatch as the result will be unused anyway. While here, add a test for autopatched rebar-based dependencies. --- test/core_deps.mk | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/core_deps.mk b/test/core_deps.mk index 4c734f9..283e0ef 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-git-submodule fetch-hex fetch-hg fetch-legacy fetch-svn ignore mv mv-rebar no-autopatch no-autopatch-erlang-mk no-autopatch-rebar order-first order-top otp pkg rel search shell skip test +CORE_DEPS_CASES = apps apps-conflict apps-deep-conflict apps-dir apps-new-app apps-new-lib apps-new-tpl apps-only autopatch-rebar 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-git-submodule fetch-hex fetch-hg fetch-legacy fetch-svn ignore mv mv-rebar 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)) @@ -391,6 +391,26 @@ core-deps-apps-only: build clean-core-deps-apps-only $i "Check that all relevant files were removed" $t test ! -e $(APP)/deps +core-deps-autopatch-rebar: build clean-core-deps-autopatch-rebar + + $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 erlsha2 to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = erlsha2\n"}' $(APP)/Makefile + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Check that erlsha2 was fetched and built" + $t test -d $(APP)/deps/erlsha2 + $t test -f $(APP)/deps/erlsha2/ebin/erlsha2.beam +ifneq ($(PLATFORM),msys2) + $t test -f $(APP)/deps/erlsha2/priv/erlsha2_nif.so +endif + ifneq ($(PLATFORM),msys2) core-deps-build-c-8cc: build clean-core-deps-build-c-8cc -- cgit v1.2.3