Commit f848ac00 authored by Michael Hanselmann's avatar Michael Hanselmann

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 =
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 \
doc/examples/bash_completion \
......@@ -357,7 +359,8 @@ srclinks: stamp-directories
set -e; \
for i in man/footer.sgml $(pkgpython_PYTHON) $(hypervisor_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 \
$(LN_S) $(abs_top_srcdir)/$$i $$i; \
fi; \
......
......@@ -83,10 +83,8 @@ class GanetiTestCase(unittest.TestCase):
be used in 'make distcheck' rules
"""
prefix = os.environ.get("srcdir", "")
if prefix:
prefix = prefix + "/test/"
return "%sdata/%s" % (prefix, name)
prefix = os.environ.get("TOP_SRCDIR", ".")
return "%s/test/data/%s" % (prefix, name)
@classmethod
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