Skip to content
Snippets Groups Projects
Commit e8c8cf1a authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add support for non-Python unittests


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a34d8cc0
No related branches found
No related tags found
No related merge requests found
...@@ -247,6 +247,7 @@ EXTRA_DIST = \ ...@@ -247,6 +247,7 @@ EXTRA_DIST = \
autotools/check-man \ autotools/check-man \
autotools/docbook-wrapper \ autotools/docbook-wrapper \
autotools/gen-coverage \ autotools/gen-coverage \
autotools/testrunner \
$(RUN_IN_TEMPDIR) \ $(RUN_IN_TEMPDIR) \
daemons/daemon-util.in \ daemons/daemon-util.in \
daemons/ganeti-cleaner.in \ daemons/ganeti-cleaner.in \
...@@ -318,7 +319,7 @@ TEST_FILES = \ ...@@ -318,7 +319,7 @@ TEST_FILES = \
test/data/proc_drbd80-emptyline.txt \ test/data/proc_drbd80-emptyline.txt \
test/data/proc_drbd83.txt test/data/proc_drbd83.txt
dist_TESTS = \ python_tests = \
test/ganeti.bdev_unittest.py \ test/ganeti.bdev_unittest.py \
test/ganeti.cli_unittest.py \ test/ganeti.cli_unittest.py \
test/ganeti.cmdlib_unittest.py \ test/ganeti.cmdlib_unittest.py \
...@@ -340,6 +341,9 @@ dist_TESTS = \ ...@@ -340,6 +341,9 @@ dist_TESTS = \
test/docs_unittest.py \ test/docs_unittest.py \
test/tempfile_fork_unittest.py test/tempfile_fork_unittest.py
dist_TESTS = \
$(python_tests)
nodist_TESTS = nodist_TESTS =
TESTS = $(dist_TESTS) $(nodist_TESTS) TESTS = $(dist_TESTS) $(nodist_TESTS)
...@@ -349,12 +353,13 @@ PLAIN_TESTS_ENVIRONMENT = \ ...@@ -349,12 +353,13 @@ PLAIN_TESTS_ENVIRONMENT = \
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR) PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) PYTHON=$(PYTHON) $(RUN_IN_TEMPDIR)
# Environment for tests run by automake # 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 = \ all_python_code = \
$(dist_sbin_SCRIPTS) \ $(dist_sbin_SCRIPTS) \
$(dist_tools_SCRIPTS) \ $(dist_tools_SCRIPTS) \
$(dist_TESTS) \ $(python_tests) \
$(pkgpython_PYTHON) \ $(pkgpython_PYTHON) \
$(hypervisor_PYTHON) \ $(hypervisor_PYTHON) \
$(rapi_PYTHON) \ $(rapi_PYTHON) \
...@@ -545,12 +550,13 @@ TAGS: $(BUILT_SOURCES) ...@@ -545,12 +550,13 @@ TAGS: $(BUILT_SOURCES)
etags - etags -
.PHONY: coverage .PHONY: coverage
coverage: $(BUILT_SOURCES) $(TESTS) coverage: $(BUILT_SOURCES) $(python_tests)
set -e; \ set -e; \
mkdir -p doc/coverage; \ mkdir -p doc/coverage; \
COVERAGE_FILE=$(CURDIR)/doc/coverage/data \ COVERAGE_FILE=$(CURDIR)/doc/coverage/data \
TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \ TEXT_COVERAGE=$(CURDIR)/doc/coverage/report.txt \
HTML_COVERAGE=$(CURDIR)/doc/coverage \ 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 : # vim: set noet :
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment