diff options
author | Loïc Hoguin <[email protected]> | 2017-05-15 20:55:06 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-05-15 21:37:08 +0200 |
commit | 0305622f259c11258cc9d56fa46af28d2206bd43 (patch) | |
tree | 84d17c6ac8b8a55455acae1f14a9e9463e823fed /test | |
parent | 9292409f21393ec539cdf40720d26b43914f6018 (diff) | |
download | erlang.mk-0305622f259c11258cc9d56fa46af28d2206bd43.tar.gz erlang.mk-0305622f259c11258cc9d56fa46af28d2206bd43.tar.bz2 erlang.mk-0305622f259c11258cc9d56fa46af28d2206bd43.zip |
Add tweaks and tests for the WITHOUT feature
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 48 | ||||
-rw-r--r-- | test/core_misc.mk | 92 |
2 files changed, 92 insertions, 48 deletions
diff --git a/test/Makefile b/test/Makefile index b5e1747..a7060ab 100644 --- a/test/Makefile +++ b/test/Makefile @@ -123,54 +123,6 @@ endef $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst plugin_%,%,$(wildcard plugin_*.mk))),$(call include_plugin,$t))) -# Tests that don't easily fit into other categories. - -core:: core-clean-crash-dump core-distclean-tmp core-help - -.PHONY: core-clean-crash-dump core-distclean-tmp core-help - -core-clean-crash-dump: build clean - - $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 "Create a fake erl_crash.dump file" - $t touch $(APP)/erl_crash.dump - - $i "Clean the application" - $t $(MAKE) -C $(APP) clean $v - - $i "Check that the crash dump is removed" - $t test ! -e $(APP)/erl_crash.dump - -core-distclean-tmp: build clean - - $i "Bootstrap a new OTP application named $(APP)" - $t mkdir $(APP)/ - $t cp ../erlang.mk $(APP)/ - $t $(MAKE) -C $(APP) -f erlang.mk bootstrap all $v - - $i "Check that a .erlang.mk directory exists" - $t test -d $(APP)/.erlang.mk - - $i "Distclean the application" - $t $(MAKE) -C $(APP) distclean $v - - $i "Check that .erlang.mk directory got removed" - $t test ! -e $(APP)/.erlang.mk - -core-help: build clean - - $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 "Run 'make help' and check that it prints help" - $t test -n "`$(MAKE) -C $(APP) help` | grep Usage" - # Packages. PACKAGES = $(foreach pkg,$(sort $(wildcard ../index/*.mk)),$(notdir $(basename $(pkg)))) diff --git a/test/core_misc.mk b/test/core_misc.mk new file mode 100644 index 0000000..9397378 --- /dev/null +++ b/test/core_misc.mk @@ -0,0 +1,92 @@ +# Core: Miscellaneous. +# +# The miscellaneous tests use the prefix "core-", not "core-misc-". + +CORE_MISC_CASES = clean-crash-dump distclean-tmp help without-edoc without-index without-many +CORE_MISC_TARGETS = $(addprefix core-,$(CORE_MISC_CASES)) + +.PHONY: $(CORE_MISC_TARGETS) + +core:: $(CORE_MISC_TARGETS) + +core-clean-crash-dump: build clean + + $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 "Create a fake erl_crash.dump file" + $t touch $(APP)/erl_crash.dump + + $i "Clean the application" + $t $(MAKE) -C $(APP) clean $v + + $i "Check that the crash dump is removed" + $t test ! -e $(APP)/erl_crash.dump + +core-distclean-tmp: build clean + + $i "Bootstrap a new OTP application named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap all $v + + $i "Check that a .erlang.mk directory exists" + $t test -d $(APP)/.erlang.mk + + $i "Distclean the application" + $t $(MAKE) -C $(APP) distclean $v + + $i "Check that .erlang.mk directory got removed" + $t test ! -e $(APP)/.erlang.mk + +core-help: build clean + + $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 "Run 'make help' and check that it prints help" + $t test -n "`$(MAKE) -C $(APP) help` | grep Usage" + +core-without-edoc: clean + + $i "Create a working directory for this test" + $t mkdir -p $(APP)/ + + $i "Generate a bleeding edge Erlang.mk without the EDoc plugin" + $t cd .. && $(MAKE) WITHOUT=plugins/edoc ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v + + $i "Confirm that the EDoc plugin was not included." + $t ! grep -q distclean-edoc $(APP)/erlang.mk + +# @todo Update Erlang.mk and confirm this sticks. + +core-without-index: clean + + $i "Create a working directory for this test" + $t mkdir -p $(APP)/ + + $i "Generate a bleeding edge Erlang.mk without the package index" + $t cd .. && $(MAKE) WITHOUT=index ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v + + $i "Confirm that the index was not included." + $t ! grep -q pkg_cowboy $(APP)/erlang.mk + +# @todo Update Erlang.mk and confirm this sticks. + +core-without-many: clean + + $i "Create a working directory for this test" + $t mkdir -p $(APP)/ + + $i "Generate a bleeding edge Erlang.mk without the index and the EDoc plugin" + $t cd .. && $(MAKE) WITHOUT="index plugins/edoc" ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v + + $i "Confirm that the EDoc plugin was not included." + $t ! grep -q distclean-edoc $(APP)/erlang.mk + + $i "Confirm that the index was not included." + $t ! grep -q pkg_cowboy $(APP)/erlang.mk |