aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-01-17 13:13:19 -0500
committerWilliam Hua <william.hua@canonical.com>2014-01-17 13:13:19 -0500
commit335ff379c254ba3b903d35ba9c89ac23f729311f (patch)
tree1c8c780db26251d92884ead91e68ae41d481f34b /tests
parentf7128240c9f9e64140dc8cd604116396bce83830 (diff)
downloadayatana-indicator-keyboard-335ff379c254ba3b903d35ba9c89ac23f729311f.tar.gz
ayatana-indicator-keyboard-335ff379c254ba3b903d35ba9c89ac23f729311f.tar.bz2
ayatana-indicator-keyboard-335ff379c254ba3b903d35ba9c89ac23f729311f.zip
Save and restore DISPLAY.
Diffstat (limited to 'tests')
-rw-r--r--tests/main.vala5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/main.vala b/tests/main.vala
index 35d40c56..c1b0bc7a 100644
--- a/tests/main.vala
+++ b/tests/main.vala
@@ -50,6 +50,8 @@ struct Fixture {
uint object_name;
}
+string display;
+
static void start_service (Fixture *fixture) {
if (fixture.connection != null) {
try {
@@ -67,6 +69,8 @@ static void start_service (Fixture *fixture) {
}
static void begin_test (void *data) {
+ Environment.set_variable ("DISPLAY", display, true);
+
var fixture = (Fixture *) data;
fixture.bus = new TestDBus (TestDBusFlags.NONE);
@@ -694,6 +698,7 @@ static void test_update_input_sources (void *data) {
}
public int main (string[] args) {
+ display = Environment.get_variable ("DISPLAY");
Environment.set_variable ("DCONF_PROFILE", DCONF_PROFILE, true);
Environment.set_variable ("LC_ALL", "C", true);