mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00

Adds --enable-coverage flag to configure Bro with gcov. A new directory named /testing/bro-code-coverage/ contains a new coverage target that as part of `make coverage` in /testing/. This coverage option creates coverage.log of all important directories in /src/ and places all generated .gcov files alongside the corresponding source file.
40 lines
903 B
Makefile
40 lines
903 B
Makefile
|
|
DIAG=diag.log
|
|
BTEST=../../aux/btest/btest
|
|
SCRIPT_COV=.tmp/script-coverage
|
|
|
|
all: cleanup btest-verbose coverage
|
|
|
|
# Showing all tests.
|
|
btest-verbose:
|
|
@$(BTEST) -j -f $(DIAG)
|
|
|
|
brief: cleanup btest-brief coverage
|
|
|
|
# Brief output showing only failed tests.
|
|
btest-brief:
|
|
@$(BTEST) -j -b -f $(DIAG)
|
|
|
|
coverage:
|
|
@../scripts/coverage-calc "$(SCRIPT_COV)/*" coverage.log `pwd`/../../scripts
|
|
|
|
cleanup:
|
|
@rm -f $(DIAG)
|
|
@rm -rf $(SCRIPT_COV)*
|
|
@find ../../ -name "*.gcda" -exec rm {} \;
|
|
|
|
distclean: cleanup
|
|
@rm -rf .btest.failed.dat \
|
|
coverage.log \
|
|
diag.log \
|
|
.tmp/
|
|
|
|
|
|
# Updates the three coverage tests that usually need tweaking when
|
|
# scripts get added/removed.
|
|
update-coverage-tests:
|
|
btest -qU coverage.bare-load-baseline
|
|
btest -qU coverage.default-load-baseline
|
|
@echo "Use 'git diff' to check updates look right."
|
|
|
|
.PHONY: all btest-verbose brief btest-brief coverage cleanup
|