From b6c3567ba40e513cbdb303099d921f693ff65914 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 12 Jan 2012 11:58:13 -0600 Subject: [PATCH] Test coverage integration for external tests and complete suite. coverage.log files are output to each testing dir and reflect the number of times statement locations of Bro scripts are executed. --- testing/.gitignore | 1 + testing/Makefile | 5 +++++ testing/external/subdir-btest.cfg | 1 + 3 files changed, 7 insertions(+) create mode 100644 testing/.gitignore diff --git a/testing/.gitignore b/testing/.gitignore new file mode 100644 index 0000000000..a664c1d684 --- /dev/null +++ b/testing/.gitignore @@ -0,0 +1 @@ +coverage.log diff --git a/testing/Makefile b/testing/Makefile index 7f03a55f49..4b4e87d82f 100644 --- a/testing/Makefile +++ b/testing/Makefile @@ -3,6 +3,11 @@ DIRS=btest external all: @for repo in $(DIRS); do (cd $$repo && make ); done + @cp btest/coverage.log `mktemp brocov.tmp.XXX` + @for f in external/*/coverage.log; do cp $$f `mktemp brocov.tmp.XXX`; done + @echo "Complete test suite code coverage:" + @./scripts/coverage-calc "brocov.tmp.*" coverage.log `pwd` + @rm -f brocov.tmp.* brief: @for repo in $(DIRS); do (cd $$repo && make brief ); done diff --git a/testing/external/subdir-btest.cfg b/testing/external/subdir-btest.cfg index dd9a57c879..e24f89255a 100644 --- a/testing/external/subdir-btest.cfg +++ b/testing/external/subdir-btest.cfg @@ -17,3 +17,4 @@ TRACES=%(testbase)s/Traces SCRIPTS=%(testbase)s/../scripts DIST=%(testbase)s/../../.. BUILD=%(testbase)s/../../../build +BROFILER_FILE=%(testbase)s/.tmp/script-coverage