diff options
author | Loïc Hoguin <[email protected]> | 2015-09-24 18:08:17 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-09-24 18:08:17 +0200 |
commit | ace7252ee3e34e803345236950e93dae590bb7c1 (patch) | |
tree | 6ada46a4db08f39be21c1609d3e7619a87522f80 /test | |
parent | 608f6a85ad68a7bbd9140fcd0258161689612df0 (diff) | |
download | erlang.mk-ace7252ee3e34e803345236950e93dae590bb7c1.tar.gz erlang.mk-ace7252ee3e34e803345236950e93dae590bb7c1.tar.bz2 erlang.mk-ace7252ee3e34e803345236950e93dae590bb7c1.zip |
Add a test for DEPS_DIR
Diffstat (limited to 'test')
-rw-r--r-- | test/core_deps.mk | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk index da801f4..3d01eb7 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 ignore 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 dir 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)) @@ -160,6 +160,40 @@ endif {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \ halt()" +core-deps-dir: build clean-core-deps-dir + + $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 with a custom DEPS_DIR" + $t sed -i.bak '2i\ +DEPS = cowboy\ +DEPS_DIR ?= \$$(CURDIR)/libs\ +' $(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 all dependencies were fetched in the custom DEPS_DIR" + $t test -d $(APP)/libs/cowboy + $t test -d $(APP)/libs/cowlib + $t test -d $(APP)/libs/ranch + + $i "Check that the application was compiled correctly" + $t $(ERL) -pa $(APP)/ebin/ $(APP)/libs/*/ebin/ -eval " \ + [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \ + {ok, Deps} = application:get_key($(APP), applications), \ + true = lists:member(cowboy, Deps), \ + halt()" + core-deps-doc: build clean-core-deps-doc $i "Bootstrap a new OTP library named $(APP)" |