From 568a977ebea54e30074d7f99e7e85306da2482df Mon Sep 17 00:00:00 2001 From: William Hua Date: Mon, 5 Oct 2015 14:13:43 -0400 Subject: Manually set XDG_RUNTIME_DIR. GLib 32492c6ab0000c50564360c74acf069814d942d1 resets it after calling TestDBus.up () and TestDBus.down (). --- tests/config.vala.in | 1 + tests/main.vala | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/config.vala.in b/tests/config.vala.in index 7acae9de..ef533d33 100644 --- a/tests/config.vala.in +++ b/tests/config.vala.in @@ -1,2 +1,3 @@ const string DCONF_PROFILE = "@abs_top_builddir@/tests/profiles/indicator-keyboard-test"; const string SERVICE_DIR = "@abs_top_builddir@/tests/services"; +const string XDG_RUNTIME_DIR = "@abs_top_builddir@/tests"; diff --git a/tests/main.vala b/tests/main.vala index dca3b8b2..e2782d1d 100644 --- a/tests/main.vala +++ b/tests/main.vala @@ -77,6 +77,8 @@ public class Tests : Object, Fixture { ((!) _bus).add_service_dir (SERVICE_DIR); ((!) _bus).up (); + Environment.set_variable ("XDG_RUNTIME_DIR", XDG_RUNTIME_DIR, true); + var loop = new MainLoop (null, false); _service_name = Bus.own_name (BusType.SESSION, @@ -130,6 +132,8 @@ public class Tests : Object, Fixture { if (_bus != null) { ((!) _bus).down (); _bus = null; + + Environment.set_variable ("XDG_RUNTIME_DIR", XDG_RUNTIME_DIR, true); } } -- cgit v1.2.3 From b5bb009d74753290d34ce34bea05a4b9b057cbef Mon Sep 17 00:00:00 2001 From: William Hua Date: Tue, 6 Oct 2015 12:56:11 -0400 Subject: Manually set GDK_BACKEND=x11. GDK wants to try Wayland first, which causes indicator-keyboard-service to fail if XDG_RUNTIME_DIR is longer than 108 characters. --- tests/indicator-keyboard-test.in | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/indicator-keyboard-test.in b/tests/indicator-keyboard-test.in index 3d43d8ab..8c20f6bf 100644 --- a/tests/indicator-keyboard-test.in +++ b/tests/indicator-keyboard-test.in @@ -5,6 +5,7 @@ export DCONF_PROFILE="@abs_top_builddir@/tests/profiles/indicator-keyboard-test" export GSETTINGS_SCHEMA_DIR="@abs_top_builddir@/data" export XDG_RUNTIME_DIR="@abs_top_builddir@/tests" export GTK_IM_MODULE="ibus" +export GDK_BACKEND="x11" if xvfb-run -a ./indicator-keyboard-tests then -- cgit v1.2.3