From: Richard W.M. Jones Date: Wed, 2 Nov 2011 19:42:29 +0000 (+0000) Subject: python: Pass $PYTHON environment variable to tests. X-Git-Tag: 1.12.10~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=49d80c6831ccb7fd949840bf9777129b7ce187bb;p=libguestfs.git python: Pass $PYTHON environment variable to tests. If the user set PYTHON when configuring, this variable is not passed through to the tests, so it is possible the tests will fail because they are testing the wrong version of python. By passing $PYTHON through to the tests we ensure that we test against the same version of python that we configured with. (cherry picked from commit e2249b7ce1dd0a2f8f110e0e47aca397185a6373) --- diff --git a/python/Makefile.am b/python/Makefile.am index 5884762..532e756 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,5 +1,5 @@ # libguestfs Python bindings -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2011 Red Hat 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 @@ -48,7 +48,8 @@ libguestfsmod_la_LDFLAGS = -avoid-version TESTS_ENVIRONMENT = \ LIBGUESTFS_PATH=$(top_builddir)/appliance \ PYTHONPATH=$(builddir):$(builddir)/.libs \ - TMPDIR=$(top_builddir) + TMPDIR=$(top_builddir) \ + PYTHON=$(PYTHON) TESTS = run-bindtests run-python-tests diff --git a/python/run-bindtests b/python/run-bindtests index 17448c3..7298a00 100755 --- a/python/run-bindtests +++ b/python/run-bindtests @@ -1,6 +1,6 @@ #!/bin/sh - # libguestfs Perl bindings -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2011 Red Hat 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 @@ -18,5 +18,5 @@ set -e -python bindtests.py > bindtests.tmp +$PYTHON bindtests.py > bindtests.tmp diff -u ../bindtests bindtests.tmp diff --git a/python/run-python-tests b/python/run-python-tests index 487f8ab..f82dc10 100755 --- a/python/run-python-tests +++ b/python/run-python-tests @@ -1,6 +1,6 @@ #!/bin/sh - # libguestfs Perl bindings -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2011 Red Hat 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 @@ -19,5 +19,5 @@ set -e for f in t/*.py; do - python $f + $PYTHON $f done