[svn] commit: r4023 - in /trunk: ./ src/bin/auth/tests/testdata/ src/bin/bind10/ src/bin/bind10/tests/ src/bin/bindctl/tests/ src/bin/cfgmgr/tests/ src/bin/cmdctl/tests/ src/bin/loadzone/tests/correct/ src/bin/loadzone/tests/error/ src/bin/msgq/tests/ src/bin/recurse/tests/ src/bin/stats/tests/ src/bin/stats/tests/isc/util/ src/bin/tests/ src/bin/xfrin/tests/ src/bin/xfrout/tests/ src/bin/zonemgr/tests/ src/lib/asiolink/ src/lib/dns/python/tests/ src/lib/python/isc/cc/tests/ src/lib/python/isc/config/tests/ src/lib/python/isc/datasrc/tests/ src/lib/python/isc/log/tests/ src/lib/python/isc/net/tests/ src/lib/python/isc/notify/tests/ src/lib/python/isc/util/tests/ src/lib/python/isc/utils/
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Dec 27 19:08:09 UTC 2010
Author: jreed
Date: Mon Dec 27 19:08:09 2010
New Revision: 4023
Log:
For trac362
139. [build] jreed
Introduced configure option and make targets for generating
Python code coverage report. This adds new make targets:
report-python-coverage and clean-python-coverage. The C++
code coverage targets were renamed to clean-cpp-coverage
and report-cpp-coverage. (Trac #362, svn r4023)
Added:
trunk/src/bin/auth/tests/testdata/ (props changed)
- copied from r4022, branches/trac362/src/bin/auth/tests/testdata/
trunk/src/lib/python/isc/utils/ (props changed)
- copied from r4022, branches/trac362/src/lib/python/isc/utils/
Modified:
trunk/ (props changed)
trunk/ChangeLog
trunk/Makefile.am
trunk/README
trunk/configure.ac
trunk/src/bin/bind10/bind10.py.in (props changed)
trunk/src/bin/bind10/tests/Makefile.am
trunk/src/bin/bindctl/tests/Makefile.am
trunk/src/bin/cfgmgr/tests/Makefile.am
trunk/src/bin/cmdctl/tests/Makefile.am
trunk/src/bin/loadzone/tests/correct/Makefile.am
trunk/src/bin/loadzone/tests/error/Makefile.am
trunk/src/bin/msgq/tests/Makefile.am
trunk/src/bin/recurse/tests/ (props changed)
trunk/src/bin/stats/tests/Makefile.am
trunk/src/bin/stats/tests/isc/util/ (props changed)
trunk/src/bin/tests/Makefile.am
trunk/src/bin/xfrin/tests/Makefile.am
trunk/src/bin/xfrout/tests/Makefile.am
trunk/src/bin/zonemgr/tests/Makefile.am
trunk/src/lib/asiolink/ (props changed)
trunk/src/lib/dns/python/tests/Makefile.am
trunk/src/lib/python/isc/cc/tests/Makefile.am
trunk/src/lib/python/isc/config/tests/Makefile.am
trunk/src/lib/python/isc/datasrc/tests/Makefile.am
trunk/src/lib/python/isc/log/tests/Makefile.am
trunk/src/lib/python/isc/net/tests/Makefile.am
trunk/src/lib/python/isc/notify/tests/Makefile.am
trunk/src/lib/python/isc/util/tests/Makefile.am
Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Mon Dec 27 19:08:09 2010
@@ -1,3 +1,10 @@
+ 139. [build] jreed
+ Introduced configure option and make targets for generating
+ Python code coverage report. This adds new make targets:
+ report-python-coverage and clean-python-coverage. The C++
+ code coverage targets were renamed to clean-cpp-coverage
+ and report-cpp-coverage. (Trac #362, svn r4023)
+
138. [func]* jinmei
b10-auth: added a configuration interface to support in memory
data sources. For example, the following command to bindctl
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Mon Dec 27 19:08:09 2010
@@ -8,20 +8,30 @@
# When running distcheck target, do not install the configurations
DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
-clean-coverage:
+clean-cpp-coverage:
@if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --directory . --zerocounters; \
rm -rf coverage/; \
else \
- echo "Code coverage not enabled at configuration time"; \
- exit 1; \
+ echo "C++ code coverage not enabled at configuration time." ; \
+ echo "Use: ./configure --with-lcov" ; \
+ fi
+
+clean-python-coverage:
+ @if [ $(USE_PYCOVERAGE) = yes ] ; then \
+ rm -f $(abs_top_srcdir)/.coverage ; \
+ rm -rf $(abs_top_srcdir)/py-coverage-html ; \
+ else \
+ echo "Python code coverage not enabled at configuration time." ; \
+ echo "Use: ./configure --with-pycoverage" ; \
fi
perform-coverage: check
-report-coverage:
- $(LCOV) --capture --directory . --output-file all.info
- $(LCOV) --remove all.info \
+report-cpp-coverage:
+ @if [ $(USE_LCOV) = yes ] ; then \
+ $(LCOV) --capture --directory . --output-file all.info ; \
+ $(LCOV) --remove all.info \
c++/4.4\*/\* \
c++/4.4\*/backward/\* \
c++/4.4\*/bits/\* \
@@ -36,10 +46,29 @@
\*_unittests.cc \
\*_unittest.cc \
\*_unittests.h \
- --output report.info
- $(GENHTML) --legend -o coverage report.info
-
+ --output report.info ; \
+ $(GENHTML) --legend -o $(abs_top_builddir)/coverage-cpp-html report.info ; \
+ echo "Generated C++ Code Coverage report in HTML at $(abs_top_builddir)/coverage-cpp-html" ; \
+ else \
+ echo "C++ code coverage not enabled at configuration time." ; \
+ echo "Use: ./configure --with-lcov" ; \
+ fi
+
+report-python-coverage:
+ @if [ $(USE_PYCOVERAGE) = yes ] ; then \
+ $(PYCOVERAGE) html -d $(abs_top_builddir)/coverage-python-html --omit=src/bin/bind10/tests/,src/bin/bindctl/tests/,src/bin/cfgmgr/tests/,src/bin/cmdctl/tests/,src/bin/loadzone/tests/,src/bin/msgq/tests/,src/bin/stats/tests/,src/bin/tests/,src/bin/xfrin/tests/,src/bin/xfrout/tests/,src/bin/zonemgr/tests/,src/lib/dns/python/tests/,src/lib/dns/tests/,src/lib/python/isc/cc/tests/,src/lib/python/isc/config/tests/,src/lib/python/isc/datasrc/tests/,src/lib/python/isc/log/tests/,src/lib/python/isc/net/tests/,src/lib/python/isc/notify/tests/,src/lib/python/isc/util/tests/ ; \
+ echo "Generated Python Code Coverage report in HTML at $(abs_top_builddir)/coverage-python-html" ; \
+ else \
+ echo "Python code coverage not enabled at configuration time." ; \
+ echo "Use: ./configure --with-pycoverage" ; \
+ fi
+
+# for python and c++ test coverage
coverage: clean-coverage perform-coverage report-coverage
+
+clean-coverage: clean-cpp-coverage clean-python-coverage
+
+report-coverage: report-cpp-coverage report-python-coverage
#### include external sources in the distributed tarball:
EXTRA_DIST = ext/asio/README
Modified: trunk/README
==============================================================================
--- trunk/README (original)
+++ trunk/README Mon Dec 27 19:08:09 2010
@@ -93,26 +93,55 @@
TEST COVERAGE
+Code coverage reports may be generated using make. These are
+based on running on the unit tests. The resulting reports are placed
+in coverage-cpp-html and coverage-python-html directories for C++
+and Python, respectively.
+
The code coverage report for the C++ tests uses LCOV. It is available
-from http://ltp.sourceforge.net/. To generate your own HTML report,
+from http://ltp.sourceforge.net/. To generate the HTML report,
first configure BIND 10 with:
./configure --with-lcov
+The code coverage report for the Python tests uses coverage.py (aka
+pycoverage). It is available from http://nedbatchelder.com/code/coverage/.
+To generate the HTML report, first configure BIND 10 with:
+
+ ./configure --with-pycoverage
+
Doing code coverage tests:
make coverage
- Does the following:
+ Does the clean, perform, and report targets for C++ and Python.
make clean-coverage
- Zeroes the lcov code coverage counters and removes the coverage HTML.
+ Zeroes the code coverage counters and removes the HTML reports
+ for C++ and Python.
make perform-coverage
- Runs the C++ tests (using googletests framework).
+ Runs the C++ (using the googletests framework) and Python
+ tests.
make report-coverage
- Generates the coverage HTML, excluding some unrelated headers.
- The HTML reports are placed in a directory called coverage/.
+ Generates the coverage reports in HTML for C++ and Python.
+
+ make clean-cpp-coverage
+ Zeroes the code coverage counters and removes the HTML report
+ for the C++ tests.
+
+ make clean-python-coverage
+ Zeroes the code coverage counters and removes the HTML report
+ for the Python tests.
+
+ make report-cpp-coverage
+ Generates the coverage report in HTML for C++, excluding
+ some unrelated headers. The HTML reports are placed in a
+ directory called coverage-cpp-html/.
+
+ make report-python-coverage
+ Generates the coverage report in HTML for Python. The HTML
+ reports are placed in a directory called coverage-python-html/.
DEVELOPERS
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Dec 27 19:08:09 2010
@@ -286,6 +286,26 @@
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SA_LEN, 1, [Define to 1 if sockaddr has a sa_len member, and corresponding sin_len and sun_len])],
AC_MSG_RESULT(no))
+
+AC_ARG_WITH(pycoverage,
+[ --with-pycoverage[=PROGRAM] enable python code coverage using the specified coverage], pycoverage="$withval", pycoverage="no")
+if test "$pycoverage" = "no" ; then
+ # just run the tests normally with python
+ PYCOVERAGE_RUN="${PYTHON}"
+ USE_PYCOVERAGE="no"
+elif test "$pycoverage" = "yes" ; then
+ PYCOVERAGE="coverage"
+ PYCOVERAGE_RUN="${PYCOVERAGE} run --branch --append"
+ USE_PYCOVERAGE="yes"
+else
+ PYCOVERAGE="$pycoverage"
+ PYCOVERAGE_RUN="${PYCOVERAGE} run --branch --append"
+ USE_PYCOVERAGE="yes"
+fi
+AM_CONDITIONAL(ENABLE_PYTHON_COVERAGE, test x$USE_PYCOVERAGE != xno)
+AC_SUBST(PYCOVERAGE)
+AC_SUBST(PYCOVERAGE_RUN)
+AC_SUBST(USE_PYCOVERAGE)
AC_ARG_WITH(lcov,
[ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
@@ -729,7 +749,8 @@
Developer:
Google Tests: $gtest_path
- Code Coverage: $USE_LCOV
+ C++ Code Coverage: $USE_LCOV
+ Python Code Coverage: $USE_PYCOVERAGE
Generate Manuals: $enable_man
END
Modified: trunk/src/bin/bind10/tests/Makefile.am
==============================================================================
--- trunk/src/bin/bind10/tests/Makefile.am (original)
+++ trunk/src/bin/bind10/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,12 +1,17 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
+#PYTESTS = args_test.py bind10_test.py
PYTESTS = bind10_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/bind10 \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/bindctl/tests/Makefile.am
==============================================================================
--- trunk/src/bin/bindctl/tests/Makefile.am (original)
+++ trunk/src/bin/bindctl/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,12 +1,16 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = bindctl_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_srcdir)/src/bin \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/cfgmgr/tests/Makefile.am
==============================================================================
--- trunk/src/bin/cfgmgr/tests/Makefile.am (original)
+++ trunk/src/bin/cfgmgr/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,13 +1,17 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = b10-cfgmgr_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/cfgmgr \
- $(PYCOVERAGE) $(abs_builddir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_builddir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/cmdctl/tests/Makefile.am
==============================================================================
--- trunk/src/bin/cmdctl/tests/Makefile.am (original)
+++ trunk/src/bin/cmdctl/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,14 +1,18 @@
+PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = cmdctl_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/cmdctl \
CMDCTL_SPEC_PATH=$(abs_top_builddir)/src/bin/cmdctl \
CMDCTL_SRC_PATH=$(abs_top_srcdir)/src/bin/cmdctl \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/loadzone/tests/correct/Makefile.am
==============================================================================
--- trunk/src/bin/loadzone/tests/correct/Makefile.am (original)
+++ trunk/src/bin/loadzone/tests/correct/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,4 +1,3 @@
-PYTESTS = correct_test.sh
EXTRA_DIST = get_zonedatas.py
EXTRA_DIST += include.db
EXTRA_DIST += inclsub.db
@@ -14,12 +13,8 @@
EXTRA_DIST += ttlext.db
EXTRA_DIST += example.db
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
+# TODO: maybe use TESTS?
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
- for pytest in $(PYTESTS) ; do \
- echo Running test: $$pytest ; \
- env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/loadzone \
- $(SHELL) $(abs_builddir)/$$pytest || exit ; \
- done
+ echo Running test: correct_test.sh
+ $(SHELL) $(abs_builddir)/correct_test.sh
Modified: trunk/src/bin/loadzone/tests/error/Makefile.am
==============================================================================
--- trunk/src/bin/loadzone/tests/error/Makefile.am (original)
+++ trunk/src/bin/loadzone/tests/error/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,5 +1,3 @@
-PYTESTS = error_test.sh
-
EXTRA_DIST = error.known
EXTRA_DIST += formerr1.db
EXTRA_DIST += formerr2.db
@@ -14,12 +12,8 @@
EXTRA_DIST += originerr1.db
EXTRA_DIST += originerr2.db
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
+# TODO: use TESTS ?
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
- for pytest in $(PYTESTS) ; do \
- echo Running test: $$pytest ; \
- env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/bin/loadzone \
- $(SHELL) $(abs_builddir)/$$pytest || exit ; \
- done
+ echo Running test: error_test.sh
+ $(SHELL) $(abs_builddir)/error_test.sh
Modified: trunk/src/bin/msgq/tests/Makefile.am
==============================================================================
--- trunk/src/bin/msgq/tests/Makefile.am (original)
+++ trunk/src/bin/msgq/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,14 +1,18 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = msgq_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/msgq:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
BIND10_TEST_SOCKET_FILE=$(builddir)/test_msgq_socket.sock \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/stats/tests/Makefile.am
==============================================================================
--- trunk/src/bin/stats/tests/Makefile.am (original)
+++ trunk/src/bin/stats/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,15 +1,19 @@
SUBDIRS = isc testdata
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = b10-stats_test.py b10-stats_stub_test.py
EXTRA_DIST = $(PYTESTS) fake_time.py
CLEANFILES = fake_time.pyc
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/stats:$(abs_top_builddir)/src/bin/stats/tests \
B10_FROM_BUILD=$(abs_top_builddir) \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/tests/Makefile.am
==============================================================================
--- trunk/src/bin/tests/Makefile.am (original)
+++ trunk/src/bin/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,13 +1,17 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = process_rename_test.py
# .py will be generated by configure, so we don't have to include it
# in EXTRA_DIST.
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs \
- $(PYCOVERAGE) $(abs_builddir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_builddir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/xfrin/tests/Makefile.am
==============================================================================
--- trunk/src/bin/xfrin/tests/Makefile.am (original)
+++ trunk/src/bin/xfrin/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,3 +1,4 @@
+PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = xfrin_test.py
EXTRA_DIST = $(PYTESTS)
@@ -8,13 +9,16 @@
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/xfr/.libs:$$$(ENV_LIBRARY_PATH)
endif
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(LIBRARY_PATH_PLACEHOLDER) \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/xfrout/tests/Makefile.am
==============================================================================
--- trunk/src/bin/xfrout/tests/Makefile.am (original)
+++ trunk/src/bin/xfrout/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,3 +1,4 @@
+PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = xfrout_test.py
EXTRA_DIST = $(PYTESTS)
@@ -8,13 +9,16 @@
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/xfr/.libs:$$$(ENV_LIBRARY_PATH)
endif
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/xfrout:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
$(LIBRARY_PATH_PLACEHOLDER) \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/bin/zonemgr/tests/Makefile.am
==============================================================================
--- trunk/src/bin/zonemgr/tests/Makefile.am (original)
+++ trunk/src/bin/zonemgr/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,14 +1,17 @@
+PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = zonemgr_test.py
EXTRA_DIST = $(PYTESTS)
-
CLEANFILES = initdb.file
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/zonemgr:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/dns/python/tests/Makefile.am
==============================================================================
--- trunk/src/lib/dns/python/tests/Makefile.am (original)
+++ trunk/src/lib/dns/python/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,3 +1,4 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = edns_python_test.py
PYTESTS += message_python_test.py
PYTESTS += messagerenderer_python_test.py
@@ -22,14 +23,17 @@
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$$$(ENV_LIBRARY_PATH)
endif
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/dns/.libs:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs \
TESTDATA_PATH=$(abs_top_srcdir)/src/lib/dns/tests/testdata:$(abs_top_builddir)/src/lib/dns/tests/testdata \
$(LIBRARY_PATH_PLACEHOLDER) \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/cc/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/cc/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/cc/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,16 +1,21 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
+
PYTESTS = message_test.py data_test.py session_test.py
# NOTE: test_session.py is to be run manually, so not automated.
EXTRA_DIST = $(PYTESTS)
EXTRA_DIST += sendcmd.py
EXTRA_DIST += test_session.py
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
BIND10_TEST_SOCKET_FILE=$(builddir)/test_socket.sock \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/config/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/config/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/config/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,16 +1,20 @@
+PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = ccsession_test.py cfgmgr_test.py config_data_test.py
PYTESTS += module_spec_test.py
EXTRA_DIST = $(PYTESTS)
EXTRA_DIST += unittest_fakesession.py
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
CONFIG_TESTDATA_PATH=$(abs_top_srcdir)/src/lib/config/tests/testdata \
CONFIG_WR_TESTDATA_PATH=$(abs_top_builddir)/src/lib/config/tests/testdata \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/datasrc/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/datasrc/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/datasrc/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,12 +1,16 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = master_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/log/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/log/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/log/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,12 +1,16 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = log_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/net/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/net/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/net/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,12 +1,16 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = addr_test.py parse_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/notify/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/notify/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/notify/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,3 +1,4 @@
+PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = notify_out_test.py
EXTRA_DIST = $(PYTESTS)
@@ -8,13 +9,16 @@
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$$$(ENV_LIBRARY_PATH)
endif
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs \
$(LIBRARY_PATH_PLACEHOLDER) \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: trunk/src/lib/python/isc/util/tests/Makefile.am
==============================================================================
--- trunk/src/lib/python/isc/util/tests/Makefile.am (original)
+++ trunk/src/lib/python/isc/util/tests/Makefile.am Mon Dec 27 19:08:09 2010
@@ -1,12 +1,16 @@
+PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = process_test.py socketserver_mixin_test.py
EXTRA_DIST = $(PYTESTS)
-# later will have configure option to choose this, like: coverage run --branch
-PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+if ENABLE_PYTHON_COVERAGE
+ touch $(abs_top_srcdir)/.coverage
+ rm -f .coverage
+ ${LN_S} $(abs_top_srcdir)/.coverage .coverage
+endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
+ $(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
More information about the bind10-changes
mailing list