aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjdamanalo <[email protected]>2023-05-08 23:45:43 +0800
committerLoïc Hoguin <[email protected]>2023-05-12 13:25:33 +0200
commit7f7db5d1e6a442aee5dba4aa98dd0594f5f3513d (patch)
tree57c7d3d0397eafa40167497dd1413739f4906a09 /test
parent0f3874feae7ec510c1d2704a37c16d5e47fe9c7d (diff)
downloaderlang.mk-7f7db5d1e6a442aee5dba4aa98dd0594f5f3513d.tar.gz
erlang.mk-7f7db5d1e6a442aee5dba4aa98dd0594f5f3513d.tar.bz2
erlang.mk-7f7db5d1e6a442aee5dba4aa98dd0594f5f3513d.zip
Support optional applications
Loïc: Added more info to guide.
Diffstat (limited to 'test')
-rw-r--r--test/core_deps.mk24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 27c3b1f..1dbf7b8 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -1124,6 +1124,30 @@ core-deps-mv-rebar: init
$i "Build the application"
$t $(MAKE) -C $(APP)-moved $v
+core-deps-optional: init
+
+ $i "Bootstrap a new OTP application named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
+
+ $i "Add quicer to the list of optional dependencies"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "OPTIONAL_DEPS = quicer\n"}' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that no dependencies were fetched"
+ $t test ! -e $(APP)/deps
+
+ $i "Check that the application was compiled correctly"
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
+ ok = application:start($(APP)), \
+ {ok, Deps} = application:get_key($(APP), applications), \
+ true = lists:member(quicer, Deps), \
+ {ok, [quicer]} = application:get_key($(APP), optional_applications), \
+ halt()"
+
# A lower-level dependency of the first dependency always
# wins over a lower-level dependency of the second dependency.
core-deps-order-first: init