aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_autopatch.mk
diff options
context:
space:
mode:
Diffstat (limited to 'test/core_autopatch.mk')
-rw-r--r--test/core_autopatch.mk41
1 files changed, 34 insertions, 7 deletions
diff --git a/test/core_autopatch.mk b/test/core_autopatch.mk
index 2624f79..7b64269 100644
--- a/test/core_autopatch.mk
+++ b/test/core_autopatch.mk
@@ -1,10 +1,10 @@
# Core: Autopatch.
-CORE_AUTOPATCH_TARGETS = $(call list_targets,core-autopatch)
+core_autopatch_TARGETS = $(call list_targets,core-autopatch)
-.PHONY: core-autopatch $(CORE_AUTOPATCH_TARGETS)
+.PHONY: core-autopatch $(core_autopatch_TARGETS)
-core-autopatch: $(CORE_AUTOPATCH_TARGETS)
+core-autopatch: $(core_autopatch_TARGETS)
core-autopatch-extended: init
@@ -34,7 +34,7 @@ core-autopatch-extended-erlc-opts: init
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
$i "Add couchbeam to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = couchbeam\n"}' $(APP)/Makefile
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = couchbeam\ndep_couchbeam = git https://github.com/benoitc/couchbeam master\n"}' $(APP)/Makefile
$i "Extend autopatch-couchbeam to add options to its ERLC_OPTS"
$t echo "autopatch-couchbeam:: ; echo >> \$$(DEPS_DIR)/couchbeam/Makefile; echo 'ERLC_OPTS += -DWITH_JIFFY' >> \$$(DEPS_DIR)/couchbeam/Makefile" >> $(APP)/Makefile
@@ -93,7 +93,7 @@ core-autopatch-no-autopatch-erlang-mk: init
# $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
#
# $i "Add Lager to the list of dependencies and to the NO_AUTOPATCH list"
-# $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\nNO_AUTOPATCH = lager\n"}' $(APP)/Makefile
+# $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\ndep_lager = git https://github.com/erlang-lager/lager master\nNO_AUTOPATCH = lager\n"}' $(APP)/Makefile
#
# $i "Build the application"
# $t $(MAKE) -C $(APP) $v
@@ -151,7 +151,7 @@ core-autopatch-rebar: init
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
$i "Add erlsha2 to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = erlsha2\n"}' $(APP)/Makefile
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = erlsha2\ndep_erlsha2 = git https://github.com/vinoski/erlsha2 master\n"}' $(APP)/Makefile
$i "Build the application"
$t $(MAKE) -C $(APP) $v
@@ -163,6 +163,33 @@ ifneq ($(PLATFORM),msys2)
$t test -f $(APP)/deps/erlsha2/priv/erlsha2_nif.so
endif
+core-autopatch-rebar-git_subdir: init
+
+ $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 application my_dep inside $(APP) that uses rebar"
+ $t mkdir $(APP)/my_dep
+ $t cp ../erlang.mk $(APP)/my_dep/
+ $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap LEGACY=1 $v
+ $t rm $(APP)/my_dep/erlang.mk $(APP)/my_dep/Makefile
+
+ $i "Add a rebar.config file with git_subdir to my_dep"
+ $t echo '{deps, [{eqwalizer_support, {git_subdir, "https://github.com/whatsapp/eqwalizer.git", {branch, "main"}, "eqwalizer_support"}} ]}.' > $(APP)/my_dep/rebar.config
+
+ $i "Add my_dep to the list of dependencies"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that eqwalizer_support was fetched and built"
+ $t test -d $(APP)/deps/eqwalizer_support
+ $t test -f $(APP)/deps/eqwalizer_support/ebin/eqwalizer.beam
+ $t test -f $(APP)/deps/eqwalizer_support/ebin/eqwalizer_specs.beam
+
# This test is expected to fail when run in parallel and flock/lockf is not available.
core-autopatch-two-rebar: init
@@ -172,7 +199,7 @@ core-autopatch-two-rebar: init
$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
$i "Add two Rebar projects to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = epgsql mochiweb\n"}' $(APP)/Makefile
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = epgsql mochiweb\ndep_epgsql = git https://github.com/epgsql/epgsql devel\ndep_mochiweb = git https://github.com/mochi/mochiweb main\n"}' $(APP)/Makefile
$i "Build the application"
$t $(MAKE) -C $(APP) $v