core_misc.mk 2.7 KB

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