test: set enviroment for testing 14/153614/1
authorBoram Park <boram1288.park@samsung.com>
Fri, 29 Sep 2017 02:39:40 +0000 (11:39 +0900)
committerBoram Park <boram1288.park@samsung.com>
Fri, 29 Sep 2017 02:40:06 +0000 (11:40 +0900)
Change-Id: I0fdd86a9c15e33b25eaf1fa0482c94472f4b025b

tools/tdm_test_server.c

index b42a0fb284682221382b94d6e6eb13ccbe20eb67..ff7b542b541a5450b3ce4789716c2b70c91ad8b6 100644 (file)
@@ -857,6 +857,26 @@ main(int argc, char *argv[])
        int len = sizeof temp;
        tdm_error ret;
 
+#if 1 /* for testing */
+       const char *s = (const char*)getenv("XDG_RUNTIME_DIR");
+       if (!s) {
+               char buf[32];
+               snprintf(buf, sizeof(buf), "/run");
+               int ret = setenv("XDG_RUNTIME_DIR", (const char*)buf, 1);
+               if (ret != 0)
+                       exit(0);
+       }
+
+       s = (const char*)getenv("TBM_DISPLAY_SERVER");
+       if (!s) {
+               char buf[32];
+               snprintf(buf, sizeof(buf), "1");
+               int ret = setenv("TBM_DISPLAY_SERVER", (const char*)buf, 1);
+               if (ret != 0)
+                       exit(0);
+       }
+#endif
+
        memset(data, 0, sizeof * data);
        LIST_INITHEAD(&data->output_list);
        LIST_INITHEAD(&data->pp_list);