core_misc.mk 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 $(CORE_MISC_TARGETS)
  7. core-misc: $(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. $i "Update Erlang.mk"
  45. $t $(MAKE) -C $(APP) -f erlang.mk erlang-mk $v
  46. $i "Confirm that the EDoc plugin is still not included."
  47. $t ! grep -q distclean-edoc $(APP)/erlang.mk
  48. core-without-index: clean
  49. $i "Create a working directory for this test"
  50. $t mkdir -p $(APP)/
  51. $i "Generate a bleeding edge Erlang.mk without the package index"
  52. $t cd .. && $(MAKE) WITHOUT=index ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v
  53. $i "Confirm that the index was not included."
  54. $t ! grep -q pkg_cowboy $(APP)/erlang.mk
  55. $i "Update Erlang.mk"
  56. $t $(MAKE) -C $(APP) -f erlang.mk erlang-mk $v
  57. $i "Confirm that the index is still not included."
  58. $t ! grep -q pkg_cowboy $(APP)/erlang.mk
  59. core-without-many: clean
  60. $i "Create a working directory for this test"
  61. $t mkdir -p $(APP)/
  62. $i "Generate a bleeding edge Erlang.mk without the index and the EDoc plugin"
  63. $t cd .. && $(MAKE) WITHOUT="index plugins/edoc" ERLANG_MK=$(CURDIR)/$(APP)/erlang.mk $v
  64. $i "Confirm that the EDoc plugin was not included."
  65. $t ! grep -q distclean-edoc $(APP)/erlang.mk
  66. $i "Confirm that the index was not included."
  67. $t ! grep -q pkg_cowboy $(APP)/erlang.mk