diff options
author | Loïc Hoguin <[email protected]> | 2015-09-21 13:04:46 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-09-21 13:04:46 +0200 |
commit | bad95de3da06fda4e8ab3e014380c7e3d49d9eee (patch) | |
tree | 8ff036c181e40198b94a57f21c21e33d003899ff | |
parent | 3b91fa449ef01d92282a56bcd3912bc77a3774d9 (diff) | |
download | erlang.mk-bad95de3da06fda4e8ab3e014380c7e3d49d9eee.tar.gz erlang.mk-bad95de3da06fda4e8ab3e014380c7e3d49d9eee.tar.bz2 erlang.mk-bad95de3da06fda4e8ab3e014380c7e3d49d9eee.zip |
Add a test for an Erlang build dependency
-rw-r--r-- | test/core_deps.mk | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk index 09d5f42..dae7be9 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 pkg search +CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl pkg search CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES)) CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS)) @@ -74,6 +74,32 @@ dep_imagejs = git https://github.com/jklmnn/imagejs master\ false = lists:member(imagejs, Deps), \ halt()" +core-deps-build-erl: build clean-core-deps-build-erl + + $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 rebar to the list of build dependencies" + $t sed -i.bak '2i\ +BUILD_DEPS = rebar\ +dep_rebar = git https://github.com/rebar/rebar master\ +' $(APP)/Makefile + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Check that all dependencies were fetched" + $t test -d $(APP)/deps/rebar + + $i "Check that the application was compiled correctly" + $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \ + [ok = application:load(App) || App <- [$(APP), rebar]], \ + {ok, Deps} = application:get_key($(APP), applications), \ + false = lists:member(rebar, Deps), \ + halt()" + core-deps-pkg: build clean-core-deps-pkg $i "Bootstrap a new OTP library named $(APP)" |