aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-21 10:35:53 +0200
committerLoïc Hoguin <[email protected]>2015-09-21 10:35:53 +0200
commit5f8fb2ab71eff70240b609f3344c99064619ad9e (patch)
tree5026cceaf9c2311db573f3086d61ef54e306de4a /test/core_deps.mk
parenta535628faa098a0cfde2d1646b75f2054af0bc72 (diff)
downloaderlang.mk-5f8fb2ab71eff70240b609f3344c99064619ad9e.tar.gz
erlang.mk-5f8fb2ab71eff70240b609f3344c99064619ad9e.tar.bz2
erlang.mk-5f8fb2ab71eff70240b609f3344c99064619ad9e.zip
Add a test where the build dependency is a C compiler
Diffstat (limited to 'test/core_deps.mk')
-rw-r--r--test/core_deps.mk31
1 files changed, 30 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 9795767..1a1729d 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -1,6 +1,6 @@
# Core: Packages and dependencies.
-CORE_DEPS_CASES = pkg search
+CORE_DEPS_CASES = build-c pkg search
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -13,6 +13,35 @@ $(CORE_DEPS_CLEAN_TARGETS):
core-deps: $(CORE_DEPS_TARGETS)
+core-deps-build-c: build clean-core-deps-build-c
+
+ $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 8cc to the list of build dependencies"
+ $t sed -i.bak '2i\
+BUILD_DEPS = 8cc\
+dep_8cc = git https://github.com/rui314/8cc master\
+' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/deps/8cc
+
+ $i "Check that 8cc can be started"
+ $t $(APP)/deps/8cc/8cc -h $v
+
+ $i "Check that the application was compiled correctly"
+ $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
+ [ok = application:load(App) || App <- [$(APP)]], \
+ {ok, Deps} = application:get_key($(APP), applications), \
+ false = lists:member('8cc', Deps), \
+ halt()"
+
core-deps-pkg: build clean-core-deps-pkg
$i "Bootstrap a new OTP library named $(APP)"