aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-21 13:37:34 +0200
committerLoïc Hoguin <[email protected]>2015-09-21 13:37:34 +0200
commit57fa7a996f6b4b11c00c5cef3ba8e8d2718fef43 (patch)
tree8c6ce0971030d2821f8c214d0feb7efc22addd58
parentc94d7873bbbee301faf61d7502c6f64b4d1ada9a (diff)
downloaderlang.mk-57fa7a996f6b4b11c00c5cef3ba8e8d2718fef43.tar.gz
erlang.mk-57fa7a996f6b4b11c00c5cef3ba8e8d2718fef43.tar.bz2
erlang.mk-57fa7a996f6b4b11c00c5cef3ba8e8d2718fef43.zip
Add a test for a JS build dependency
-rw-r--r--test/core_deps.mk28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 6b95a8b..3312b24 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 pkg search
+CORE_DEPS_CASES = build-c-8cc build-c-imagejs build-erl build-js pkg search
CORE_DEPS_TARGETS = $(addprefix core-deps-,$(CORE_DEPS_CASES))
CORE_DEPS_CLEAN_TARGETS = $(addprefix clean-,$(CORE_DEPS_TARGETS))
@@ -99,6 +99,32 @@ BUILD_DEPS = cowlib\
false = lists:member(cowlib, Deps), \
halt()"
+core-deps-build-js: build clean-core-deps-build-js
+
+ $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 jquery to the list of build dependencies"
+ $t sed -i.bak '2i\
+BUILD_DEPS = jquery\
+dep_jquery = git https://github.com/jquery/jquery master\
+' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all dependencies were fetched"
+ $t test -d $(APP)/deps/jquery
+
+ $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(jquery, Deps), \
+ halt()"
+
core-deps-pkg: build clean-core-deps-pkg
$i "Bootstrap a new OTP library named $(APP)"