summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-24 17:45:08 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-25 10:21:06 +0000
commit256a8f67c22404a65d27628537d15d7164ae54d1 (patch)
tree6fa05c51366177f1830768490bced8d939a9bb48
parentd20026879e6ddbb22b955b2a88c57c5563642c56 (diff)
All C/C++ tests: run with temporary XDG_*_HOME, XDG_RUNTIME_DIR
These aren't currently used, so we don't actually create them... except for tests/logger/dbus/tmp-cache/telepathy/logger/sqlite-data, which is in fact created by running the tests.
-rw-r--r--.gitignore4
-rw-r--r--tests/Makefile.am7
-rw-r--r--tests/dbus/Makefile.am6
-rw-r--r--tests/logger/Makefile.am6
-rw-r--r--tests/logger/dbus/Makefile.am6
5 files changed, 29 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index efb972209..88ebcf765 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 a0d750c62..22bb8a224 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 =
@@ -213,3 +217,6 @@ AM_CXXFLAGS = $(ERROR_CXXFLAGS)
if HAVE_CXX
test_util_cxx_SOURCES = util-cxx.cpp
endif
+
+clean-local:
+ rm -fr tmp-cache tmp-config tmp-data tmp-runtime
diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am
index d061505a4..027defa81 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 \
@@ -378,3 +381,6 @@ _gen/errors-check.h: $(top_srcdir)/spec/errors.xml \
$(top_srcdir)/tools/glib-errors-check-gen.py
$(AM_V_at)$(MKDIR_P) _gen
$(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-errors-check-gen.py $< > $@
+
+clean-local:
+ rm -fr tmp-cache tmp-config tmp-runtime
diff --git a/tests/logger/Makefile.am b/tests/logger/Makefile.am
index ef61231dd..938187d14 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)
@@ -52,3 +55,6 @@ check_c_sources = \
include $(top_srcdir)/tools/check-coding-style.mk
check-local: check-coding-style
+
+clean-local:
+ rm -fr tmp-cache tmp-config tmp-runtime
diff --git a/tests/logger/dbus/Makefile.am b/tests/logger/dbus/Makefile.am
index 35ddb5335..c322cea66 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) \
@@ -73,3 +76,6 @@ CLEANFILES = $(BUILT_SOURCES)
distclean-local:
rm -f capture-*.log
rm -rf _gen
+
+clean-local:
+ rm -fr tmp-cache tmp-config tmp-data tmp-runtime