aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_upgrade.mk
diff options
context:
space:
mode:
Diffstat (limited to 'test/core_upgrade.mk')
-rw-r--r--test/core_upgrade.mk50
1 files changed, 37 insertions, 13 deletions
diff --git a/test/core_upgrade.mk b/test/core_upgrade.mk
index c4a8725..64a8b5d 100644
--- a/test/core_upgrade.mk
+++ b/test/core_upgrade.mk
@@ -1,19 +1,42 @@
# Core: Erlang.mk upgrade.
-CORE_UPGRADE_CASES = custom-build-dir custom-config custom-repo no-config renamed-config
+CORE_UPGRADE_CASES = conflicting-configs custom-build-dir custom-config custom-repo no-config renamed-config
CORE_UPGRADE_TARGETS = $(addprefix core-upgrade-,$(CORE_UPGRADE_CASES))
-CORE_UPGRADE_CLEAN_TARGETS = $(addprefix clean-,$(CORE_UPGRADE_TARGETS))
-.PHONY: core-upgrade $(CORE_UPGRADE_TARGETS) clean-core-upgrade $(CORE_UPGRADE_CLEAN_TARGETS)
+.PHONY: core-upgrade $(CORE_UPGRADE_TARGETS)
-clean-core-upgrade: $(CORE_UPGRADE_CLEAN_TARGETS)
+core-upgrade: $(CORE_UPGRADE_TARGETS)
-$(CORE_UPGRADE_CLEAN_TARGETS):
- $t rm -rf $(APP_TO_CLEAN)/
+core-upgrade-conflicting-configs: build clean
-core-upgrade: $(CORE_UPGRADE_TARGETS)
+ $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 "Fork erlang.mk locally and modify it"
+ $t git clone -q https://github.com/ninenines/erlang.mk $(APP)/alt-erlangmk-repo
+ $t echo core/core > $(APP)/alt-erlangmk-repo/build.config
+ $t (cd $(APP)/alt-erlangmk-repo && \
+ git checkout -q -b test-modified-build.config && \
+ git config user.email "[email protected]" && \
+ git config user.name "test suite" && \
+ git commit -q -a -m 'Modify build.config' && \
+ git checkout master)
+
+ $i "Point application to an alternate erlang.mk repository"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "ERLANG_MK_REPO = file://$(abspath $(APP)/alt-erlangmk-repo)\nERLANG_MK_COMMIT = test-modified-build.config\n"}' $(APP)/Makefile
+
+ $i "Create a custom build.config file without plugins"
+ $t echo "core/*" > $(APP)/build.config
+
+ $i "Upgrade Erlang.mk"
+ $t $(MAKE) -C $(APP) erlang-mk $v
+
+ $i "Check that the bootstrap plugin is gone"
+ $t ! $(MAKE) -C $(APP) list-templates $v
-core-upgrade-custom-build-dir: build clean-core-upgrade-custom-build-dir
+core-upgrade-custom-build-dir: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -39,7 +62,7 @@ core-upgrade-custom-build-dir: build clean-core-upgrade-custom-build-dir
$i "Check that the custom build directory is gone"
$t test ! -d $(APP)/custom/
-core-upgrade-custom-config: build clean-core-upgrade-custom-config
+core-upgrade-custom-config: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -55,7 +78,7 @@ core-upgrade-custom-config: build clean-core-upgrade-custom-config
$i "Check that the bootstrap plugin is gone"
$t ! $(MAKE) -C $(APP) list-templates $v
-core-upgrade-custom-repo: build clean-core-upgrade-custom-repo
+core-upgrade-custom-repo: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -69,7 +92,8 @@ core-upgrade-custom-repo: build clean-core-upgrade-custom-repo
git checkout -q -b test-copyright && \
git config user.email "[email protected]" && \
git config user.name "test suite" && \
- git commit -q -a -m 'Add Testsuite copyright')
+ git commit -q -a -m 'Add Testsuite copyright' && \
+ git checkout master)
$i "Point application to an alternate erlang.mk repository"
$t perl -ni.bak -e 'print;if ($$.==1) {print "ERLANG_MK_REPO = file://$(abspath $(APP)/alt-erlangmk-repo)\nERLANG_MK_COMMIT = test-copyright\n"}' $(APP)/Makefile
@@ -80,7 +104,7 @@ core-upgrade-custom-repo: build clean-core-upgrade-custom-repo
$i "Check our modification is there"
$t grep -q "# Copyright (c) erlang.mk Testsuite!" $(APP)/erlang.mk
-core-upgrade-no-config: build clean-core-upgrade-no-config
+core-upgrade-no-config: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -99,7 +123,7 @@ core-upgrade-no-config: build clean-core-upgrade-no-config
$i "Check that the rule is gone"
$t ! $(MAKE) -C $(APP) erlang_mk_upgrade_test_rule $v
-core-upgrade-renamed-config: build clean-core-upgrade-renamed-config
+core-upgrade-renamed-config: build clean
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/