diff options
author | Jean-Sébastien Pédron <[email protected]> | 2015-10-26 15:21:11 +0100 |
---|---|---|
committer | Jean-Sébastien Pédron <[email protected]> | 2015-11-21 21:32:35 +0100 |
commit | 5ae1d353471fd2da01924d9a3ed9872678b49887 (patch) | |
tree | a156b7831b50a37320c709cf01c6125de05432d3 /test/core_deps.mk | |
parent | bd6e00675e2b87cf031017b931a02353fc67b250 (diff) | |
download | erlang.mk-5ae1d353471fd2da01924d9a3ed9872678b49887.tar.gz erlang.mk-5ae1d353471fd2da01924d9a3ed9872678b49887.tar.bz2 erlang.mk-5ae1d353471fd2da01924d9a3ed9872678b49887.zip |
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.
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r-- | test/core_deps.mk | 22 |
1 files changed, 21 insertions, 1 deletions
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 |