autotools/check-man \
autotools/docbook-wrapper \
autotools/gen-coverage \
+ autotools/testrunner \
$(RUN_IN_TEMPDIR) \
daemons/daemon-util.in \
daemons/ganeti-cleaner.in \
test/data/proc_drbd80-emptyline.txt \
test/data/proc_drbd83.txt
-dist_TESTS = \
+python_tests = \
test/ganeti.bdev_unittest.py \
test/ganeti.cli_unittest.py \
test/ganeti.cmdlib_unittest.py \
test/docs_unittest.py \
test/tempfile_fork_unittest.py
+dist_TESTS = \
+ $(python_tests)
+
nodist_TESTS =
TESTS = $(dist_TESTS) $(nodist_TESTS)
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
# Environment for tests run by automake
-TESTS_ENVIRONMENT = $(PLAIN_TESTS_ENVIRONMENT) $(PYTHON)
+TESTS_ENVIRONMENT = \
+ $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/testrunner
all_python_code = \
$(dist_sbin_SCRIPTS) \
$(dist_tools_SCRIPTS) \
- $(dist_TESTS) \
+ $(python_tests) \
$(pkgpython_PYTHON) \
$(hypervisor_PYTHON) \
$(rapi_PYTHON) \
etags -
.PHONY: coverage
-coverage: $(BUILT_SOURCES) $(TESTS)
+coverage: $(BUILT_SOURCES) $(python_tests)
set -e; \
mkdir -p doc/coverage; \
COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
HTML_COVERAGE=$(CURDIR)/doc/coverage \
- $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage $(TESTS)
+ $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
+ $(python_tests)
# vim: set noet :
--- /dev/null
+#!/bin/bash
+#
+
+# Copyright (C) 2010 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+set -e
+
+filename=$1
+
+case "$filename" in
+ *.py) exec $PYTHON "$@" ;;
+ *) exec "$@" ;;
+esac