[libvirt] [dbus PATCH v2 0/5] tests: Some fixes and cleanups

Changes from [v1]: * use the correct paths; * fix running libvirt-dbus from VPATH builds; * fix distcheck. [v1] https://www.redhat.com/archives/libvir-list/2018-June/msg01453.html Andrea Bolognani (5): tests: Include xmldata.py in EXTRA_DIST run: Fix VIRT_DBUS_INTERFACES_DIR run: Export abs_top_builddir tests: Drop fallback path for abs_top_builddir tests: Use AM_TESTS_ENVIRONMENT run.in | 6 ++---- tests/Makefile.am | 7 ++++--- tests/libvirttest.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.17.1

This fixes distcheck. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index e841627..3872d7b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,5 @@ test_helpers = \ + xmldata.py \ libvirttest.py \ conftest.py -- 2.17.1

The D-Bus interface files are in the source directory, not in the build directory. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- run.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/run.in b/run.in index e98edaf..03e7c64 100644 --- a/run.in +++ b/run.in @@ -14,9 +14,6 @@ # ./run gdb --args ./src/libvirt-dbus [args ...] # -# Find this script -b=@abs_top_builddir@ - -export VIRT_DBUS_INTERFACES_DIR="$b/data" +export VIRT_DBUS_INTERFACES_DIR="@abs_top_srcdir@/data" exec "$@" -- 2.17.1

The test suite uses this environment variable, if it's present, to locate the libvirt-dbus binary. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- run.in | 1 + 1 file changed, 1 insertion(+) diff --git a/run.in b/run.in index 03e7c64..0744a80 100644 --- a/run.in +++ b/run.in @@ -14,6 +14,7 @@ # ./run gdb --args ./src/libvirt-dbus [args ...] # +export abs_top_builddir="@abs_top_builddir@" export VIRT_DBUS_INTERFACES_DIR="@abs_top_srcdir@/data" exec "$@" -- 2.17.1

We have made sure all callers set up the environment correctly, so it's pointless to have a fallback path now. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/libvirttest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libvirttest.py b/tests/libvirttest.py index 06e52c0..3741abd 100644 --- a/tests/libvirttest.py +++ b/tests/libvirttest.py @@ -10,7 +10,7 @@ import time import xmldata -root = os.environ.get('abs_top_builddir', os.path.dirname(os.path.dirname(__file__))) +root = os.environ.get('abs_top_builddir') exe = os.path.join(root, 'src', 'libvirt-dbus') DBusGMainLoop(set_as_default=True) -- 2.17.1

According to the documentation[1], TESTS_ENVIRONMENT is reserved for the user, which means we shouldn't be using it. AM_TESTS_ENVIRONMENT needs to be terminated with a semicolon, which in turn requires exporting the variables instead of merely declaring them, so do both of those things; since we're rewriting the whole hunk anyway, we also take the opportunity use proper quoting. [1] https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Tes... Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3872d7b..1fc240b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -37,6 +37,6 @@ EXTRA_DIST = \ TESTS = $(test_programs) -TESTS_ENVIRONMENT = \ - abs_top_builddir=$(abs_top_builddir) \ - VIRT_DBUS_INTERFACES_DIR=$(abs_top_srcdir)/data +AM_TESTS_ENVIRONMENT = \ + export abs_top_builddir="$(abs_top_builddir)"; \ + export VIRT_DBUS_INTERFACES_DIR="$(abs_top_srcdir)/data"; -- 2.17.1

On Thu, Jun 21, 2018 at 01:04:54PM +0200, Andrea Bolognani wrote:
Changes from [v1]:
* use the correct paths; * fix running libvirt-dbus from VPATH builds; * fix distcheck.
[v1] https://www.redhat.com/archives/libvir-list/2018-June/msg01453.html
Andrea Bolognani (5): tests: Include xmldata.py in EXTRA_DIST run: Fix VIRT_DBUS_INTERFACES_DIR run: Export abs_top_builddir tests: Drop fallback path for abs_top_builddir tests: Use AM_TESTS_ENVIRONMENT
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Andrea Bolognani
-
Pavel Hrdina