aminclude_static.am 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # aminclude_static.am generated automatically by Autoconf
  2. # from AX_AM_MACROS_STATIC on Fri Feb 18 15:44:22 CET 2022
  3. # Code coverage
  4. #
  5. # Optional:
  6. # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
  7. # Multiple directories may be specified, separated by whitespace.
  8. # (Default: $(top_builddir))
  9. # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
  10. # by lcov for code coverage. (Default:
  11. # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
  12. # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
  13. # reports to be created. (Default:
  14. # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
  15. # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
  16. # set to 0 to disable it and leave empty to stay with the default.
  17. # (Default: empty)
  18. # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
  19. # instances. (Default: based on )
  20. # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
  21. # instances. (Default: )
  22. # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
  23. # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
  24. # collecting lcov instance. (Default: )
  25. # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
  26. # instance. (Default: )
  27. # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
  28. # lcov instance. (Default: empty)
  29. # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
  30. # instance. (Default: )
  31. # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
  32. # genhtml instance. (Default: based on )
  33. # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
  34. # instance. (Default: )
  35. # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
  36. #
  37. # The generated report will be titled using the $(PACKAGE_NAME) and
  38. # $(PACKAGE_VERSION). In order to add the current git hash to the title,
  39. # use the git-version-gen script, available online.
  40. # Optional variables
  41. # run only on top dir
  42. if CODE_COVERAGE_ENABLED
  43. ifeq ($(abs_builddir), $(abs_top_builddir))
  44. CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
  45. CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
  46. CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
  47. CODE_COVERAGE_BRANCH_COVERAGE ?=
  48. CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  49. CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  50. CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
  51. CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  52. CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  53. CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
  54. CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  55. CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=$(if $(CODE_COVERAGE_BRANCH_COVERAGE),--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  56. CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  57. CODE_COVERAGE_IGNORE_PATTERN ?=
  58. GITIGNOREFILES = $(GITIGNOREFILES) $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  59. code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
  60. code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
  61. code_coverage_v_lcov_cap_0 = @echo " LCOV --capture" $(CODE_COVERAGE_OUTPUT_FILE);
  62. code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
  63. code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
  64. code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN);
  65. code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
  66. code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
  67. code_coverage_v_genhtml_0 = @echo " GEN " "$(CODE_COVERAGE_OUTPUT_DIRECTORY)";
  68. code_coverage_quiet = $(code_coverage_quiet_$(V))
  69. code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
  70. code_coverage_quiet_0 = --quiet
  71. # sanitizes the test-name: replaces with underscores: dashes and dots
  72. code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
  73. # Use recursive makes in order to ignore errors during check
  74. check-code-coverage:
  75. -$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
  76. $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
  77. # Capture code coverage data
  78. code-coverage-capture: code-coverage-capture-hook
  79. $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
  80. $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
  81. -@rm -f "$(CODE_COVERAGE_OUTPUT_FILE).tmp"
  82. $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
  83. @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
  84. code-coverage-clean:
  85. -$(LCOV) --directory $(top_builddir) -z
  86. -rm -rf "$(CODE_COVERAGE_OUTPUT_FILE)" "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "$(CODE_COVERAGE_OUTPUT_DIRECTORY)"
  87. -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
  88. code-coverage-dist-clean:
  89. AM_DISTCHECK_CONFIGURE_FLAGS = $(AM_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage
  90. else # ifneq ($(abs_builddir), $(abs_top_builddir))
  91. check-code-coverage:
  92. code-coverage-capture: code-coverage-capture-hook
  93. code-coverage-clean:
  94. code-coverage-dist-clean:
  95. endif # ifeq ($(abs_builddir), $(abs_top_builddir))
  96. else #! CODE_COVERAGE_ENABLED
  97. # Use recursive makes in order to ignore errors during check
  98. check-code-coverage:
  99. @echo "Need to reconfigure with --enable-code-coverage"
  100. # Capture code coverage data
  101. code-coverage-capture: code-coverage-capture-hook
  102. @echo "Need to reconfigure with --enable-code-coverage"
  103. code-coverage-clean:
  104. code-coverage-dist-clean:
  105. endif #CODE_COVERAGE_ENABLED
  106. # Hook rule executed before code-coverage-capture, overridable by the user
  107. code-coverage-capture-hook:
  108. .PHONY: check-code-coverage code-coverage-capture code-coverage-dist-clean code-coverage-clean code-coverage-capture-hook