From 2174be3bfe1bf4b1cccf35909693c885ffff5576 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 24 Mar 2014 12:49:22 +0000 Subject: [PATCH] All C/C++ tests: run with temporary XDG_*_HOME, XDG_RUNTIME_DIR These aren't currently used, so we don't actually create them. --- .gitignore | 4 ++++ tests/Makefile.am | 4 ++++ tests/dbus/Makefile.am | 3 +++ tests/logger/Makefile.am | 3 +++ tests/logger/dbus/Makefile.am | 3 +++ 5 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index efb9722..88ebcf7 100644 --- a/.gitignore +++ b/.gitignore @@ -147,6 +147,10 @@ telepathy-glib/version.h /test-driver /tests/all-errors-documented.py.log /tests/all-errors-documented.py.trs +/tests/**/tmp-cache +/tests/**/tmp-config +/tests/**/tmp-data +/tests/**/tmp-runtime tests/dbus/dbus-installed/session.conf tests/dbus/dbus-uninstalled/session.conf tests/dbus/run-test.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index a0d750c..10698c9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -69,6 +69,10 @@ AM_TESTS_ENVIRONMENT = \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ G_MESSAGES_DEBUG=all \ PYTHONPATH=@abs_top_srcdir@/tools \ + XDG_CACHE_HOME=@abs_builddir@/tmp-cache \ + XDG_CONFIG_HOME=@abs_builddir@/tmp-config \ + XDG_DATA_HOME=@abs_builddir@/tmp-data \ + XDG_RUNTIME_DIR=@abs_builddir@/tmp-runtime \ $(NULL) LOG_COMPILER = diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am index d061505..46e1854 100644 --- a/tests/dbus/Makefile.am +++ b/tests/dbus/Makefile.am @@ -301,8 +301,11 @@ AM_CFLAGS = $(ERROR_CFLAGS) AM_TESTS_ENVIRONMENT = \ abs_top_builddir=@abs_top_builddir@ \ + XDG_CACHE_HOME=@abs_builddir@/tmp-cache \ + XDG_CONFIG_HOME=@abs_builddir@/tmp-config \ XDG_DATA_HOME=@abs_builddir@ \ XDG_DATA_DIRS=@abs_srcdir@:$${XDG_DATA_DIRS:=/usr/local/share:/usr/share} \ + XDG_RUNTIME_DIR=@abs_builddir@/tmp-runtime \ G_SLICE=debug-blocks \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ G_MESSAGES_DEBUG=all \ diff --git a/tests/logger/Makefile.am b/tests/logger/Makefile.am index ef61231..907bee1 100644 --- a/tests/logger/Makefile.am +++ b/tests/logger/Makefile.am @@ -29,7 +29,10 @@ AM_CFLAGS = \ AM_TESTS_ENVIRONMENT = \ G_DEBUG=fatal-warnings,fatal-criticals \ TPL_TEST_MODE=true \ + XDG_CACHE_HOME=@abs_builddir@/tmp-cache \ + XDG_CONFIG_HOME=@abs_builddir@/tmp-config \ XDG_DATA_HOME=@abs_top_srcdir@/tests/logger/logs \ + XDG_RUNTIME_DIR=@abs_builddir@/tmp-runtime \ $(NULL) check-valgrind: $(TESTS) diff --git a/tests/logger/dbus/Makefile.am b/tests/logger/dbus/Makefile.am index 35ddb53..5ffd661 100644 --- a/tests/logger/dbus/Makefile.am +++ b/tests/logger/dbus/Makefile.am @@ -45,8 +45,11 @@ AM_TESTS_ENVIRONMENT = \ TPL_TEST_LOG_DIR=@abs_top_srcdir@/tests/logger/logs \ HOME=@abs_top_srcdir@/tests/logger/logs \ GSETTINGS_SCHEMA_DIR=@abs_srcdir@/data \ + XDG_CACHE_HOME=@abs_builddir@/tmp-cache \ + XDG_CONFIG_HOME=@abs_builddir@/tmp-config \ XDG_DATA_HOME=@abs_top_srcdir@/tests/logger/logs \ XDG_DATA_DIRS=@abs_srcdir@ \ + XDG_RUNTIME_DIR=@abs_builddir@/tmp-runtime \ G_SLICE=debug-blocks \ TPL_DEBUG=all \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ -- 1.9.1