core_misc.mk 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Core: Miscellaneous.
  2. #
  3. # The miscellaneous tests use the prefix "core-", not "core-misc-".
  4. CORE_MISC_CASES = clean-crash-dump distclean-tmp help without-edoc without-index without-many
  5. CORE_MISC_TARGETS = $(addprefix core-,$(CORE_MISC_CASES))
  6. .PHONY: $(CORE_MISC_TARGETS)
  7. core:: $(CORE_MISC_TARGETS)
  8. core-clean-crash-dump: build clean
  9. $i "Bootstrap a new OTP library named $(APP)"
  10. $t mkdir $(APP)/
  11. $t cp ../erlang.mk $(APP)/
  12. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  13. $i "Create a fake erl_crash.dump file"
  14. $t touch $(APP)/erl_crash.dump
  15. $i "Clean the application"
  16. $t $(MAKE) -C $(APP) clean $v
  17. $i "Check that the crash dump is removed"
  18. $t test ! -e $(APP)/erl_crash.dump
  19. core-distclean-tmp: build clean
  20. $i "Bootstrap a new OTP application named $(APP)"
  21. $t mkdir $(APP)/
  22. $t cp ../erlang.mk $(APP)/
  23. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap all $v
  24. $i "Check that a .erlang.mk directory exists"
  25. $t test -d $(APP)/.erlang.mk
  26. $i "Distclean the application"
  27. $t $(MAKE) -C $(APP) distclean $v
  28. $i "Check that .erlang.mk directory got removed"
  29. $t test ! -e $(APP)/.erlang.mk
  30. core-help: build clean
  31. $i "Bootstrap a new OTP library named $(APP)"
  32. $t mkdir $(APP)/
  33. $t cp ../erlang.mk $(APP)/
  34. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  35. $i "Run 'make help' and check that it prints help"
  36. $t test -n "`$(MAKE) -C $(APP) help` | grep Usage"
  37. core-without-edoc: clean
  38. $i "Create a working directory for this test"
  39. $t mkdir -p $(APP)/
  40. $i "Generate a bleeding edge Erlang.mk without the EDoc plugin"
  41. $t cd .. && $(MAKE) WITHOUT=plugins/edoc ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v
  42. $i "Confirm that the EDoc plugin was not included."
  43. $t ! grep -q distclean-edoc $(APP)/erlang.mk
  44. # @todo Update Erlang.mk and confirm this sticks.
  45. core-without-index: clean
  46. $i "Create a working directory for this test"
  47. $t mkdir -p $(APP)/
  48. $i "Generate a bleeding edge Erlang.mk without the package index"
  49. $t cd .. && $(MAKE) WITHOUT=index ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v
  50. $i "Confirm that the index was not included."
  51. $t ! grep -q pkg_cowboy $(APP)/erlang.mk
  52. # @todo Update Erlang.mk and confirm this sticks.
  53. core-without-many: clean
  54. $i "Create a working directory for this test"
  55. $t mkdir -p $(APP)/
  56. $i "Generate a bleeding edge Erlang.mk without the index and the EDoc plugin"
  57. $t cd .. && $(MAKE) WITHOUT="index plugins/edoc" ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v
  58. $i "Confirm that the EDoc plugin was not included."
  59. $t ! grep -q distclean-edoc $(APP)/erlang.mk
  60. $i "Confirm that the index was not included."
  61. $t ! grep -q pkg_cowboy $(APP)/erlang.mk