diff options
author | Loïc Hoguin <[email protected]> | 2015-09-24 00:27:13 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-09-24 00:27:13 +0200 |
commit | 6a46aaaa0a79c8b4af8425a8fd930a7ba7dad54e (patch) | |
tree | ccbca1d2233f8804ab120aa5fbd39c4e5402c879 /test/core_deps.mk | |
parent | 43c4414f2938ff2083216171164b6c6ba7b0de26 (diff) | |
download | erlang.mk-6a46aaaa0a79c8b4af8425a8fd930a7ba7dad54e.tar.gz erlang.mk-6a46aaaa0a79c8b4af8425a8fd930a7ba7dad54e.tar.bz2 erlang.mk-6a46aaaa0a79c8b4af8425a8fd930a7ba7dad54e.zip |
Add test for the cp fetch method
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r-- | test/core_deps.mk | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk index e755f38..88c2137 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-git fetch-hg fetch-svn 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-git fetch-hg fetch-svn otp pkg rel search shell test CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES)) CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS)) @@ -200,6 +200,43 @@ EDOC_OPTS = {doclet, edown_doclet}\ $t test -f $(APP)/doc/boy.md $t test -f $(APP)/doc/girl.md +core-deps-fetch-cp: build clean-core-deps-fetch-cp + + $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 "Bootstrap a new OTP library named my_dep inside $(APP)" + $t mkdir $(APP)/my_dep + $t cp ../erlang.mk $(APP)/my_dep/ + $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v + + $i "Add my_dep to the list of dependencies" + $t sed -i.bak '2i\ +DEPS = my_dep\ +dep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\ +' $(APP)/Makefile + +ifdef LEGACY + $i "Add my_dep to the applications key in the .app.src file" + $t sed -i.bak '8i\ + my_dep,' $(APP)/src/$(APP).app.src +endif + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Check that all dependencies were fetched" + $t test -d $(APP)/deps/my_dep + + $i "Check that the application was compiled correctly" + $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \ + [ok = application:load(App) || App <- [$(APP), my_dep]], \ + {ok, Deps} = application:get_key($(APP), applications), \ + true = lists:member(my_dep, Deps), \ + halt()" + core-deps-fetch-git: build clean-core-deps-fetch-git $i "Bootstrap a new OTP library named $(APP)" |