Commit f848ac00 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Run unittests in a temporary directory


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent bb46a96c
...@@ -263,7 +263,9 @@ nodist_TESTS = ...@@ -263,7 +263,9 @@ nodist_TESTS =
TESTS = $(dist_TESTS) $(nodist_TESTS) TESTS = $(dist_TESTS) $(nodist_TESTS)
TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir) $(PYTHON) TESTS_ENVIRONMENT = \
PYTHONPATH=. TOP_SRCDIR=$(abs_top_srcdir) \
$(RUN_IN_TEMPDIR) $(PYTHON)
all-local: stamp-directories devel/upload \ all-local: stamp-directories devel/upload \
doc/examples/bash_completion \ doc/examples/bash_completion \
...@@ -357,7 +359,8 @@ srclinks: stamp-directories ...@@ -357,7 +359,8 @@ srclinks: stamp-directories
set -e; \ set -e; \
for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \ for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_PYTHON) \
$(rapi_PYTHON) $(http_PYTHON) $(confd_PYTHON) \ $(rapi_PYTHON) $(http_PYTHON) $(confd_PYTHON) \
$(dist_sbin_SCRIPTS) $(dist_tools_SCRIPTS); do \ $(dist_sbin_SCRIPTS) $(dist_tools_SCRIPTS) \
$(dist_TESTS); do \
if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \ if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
$(LN_S) $(abs_top_srcdir)/$$i $$i; \ $(LN_S) $(abs_top_srcdir)/$$i $$i; \
fi; \ fi; \
......
...@@ -83,10 +83,8 @@ class GanetiTestCase(unittest.TestCase): ...@@ -83,10 +83,8 @@ class GanetiTestCase(unittest.TestCase):
be used in 'make distcheck' rules be used in 'make distcheck' rules
""" """
prefix = os.environ.get("srcdir", "") prefix = os.environ.get("TOP_SRCDIR", ".")
if prefix: return "%s/test/data/%s" % (prefix, name)
prefix = prefix + "/test/"
return "%sdata/%s" % (prefix, name)
@classmethod @classmethod
def _ReadTestData(cls, name): def _ReadTestData(cls, name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment