[gnome-desktop/wip/hadess/thumbnail-font-cache] tests: Output reftest output in meson-logs



commit de385f91ca41f19b351e0084ab079f132b989e2a
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 8 16:16:27 2019 +0100

    tests: Output reftest output in meson-logs
    
    So that failed tests can have their data exported via the CI.

 tests/wallclock-reftest.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/wallclock-reftest.c b/tests/wallclock-reftest.c
index 6428ebe4..a0eaed99 100644
--- a/tests/wallclock-reftest.c
+++ b/tests/wallclock-reftest.c
@@ -27,6 +27,8 @@
 #define GNOME_DESKTOP_USE_UNSTABLE_API 1
 #include <libgnome-desktop/gnome-wall-clock.h>
 
+static const char *output_dir = NULL;
+
 typedef enum {
   SNAPSHOT_WINDOW,
   SNAPSHOT_DRAW
@@ -39,14 +41,13 @@ static char *
 get_output_file (const char *test_file,
                  const char *extension)
 {
-  const char *output_dir = g_get_tmp_dir ();
   char *result, *base;
 
   base = g_path_get_basename (test_file);
   if (g_str_has_suffix (base, ".ui"))
     base[strlen (base) - strlen (".ui")] = '\0';
 
-  result = g_strconcat (output_dir, G_DIR_SEPARATOR_S, base, extension, NULL);
+  result = g_strconcat (output_dir, G_DIR_SEPARATOR_S, "..", G_DIR_SEPARATOR_S, "meson-logs", 
G_DIR_SEPARATOR_S, base, extension, NULL);
   g_free (base);
 
   return result;
@@ -578,6 +579,9 @@ main (int argc, char **argv)
   basedir = g_getenv ("G_TEST_SRCDIR");
   if (basedir == NULL)
     basedir = INSTALLED_TEST_DIR;
+  output_dir = g_getenv ("G_TEST_BUILDDIR");
+  if (output_dir == NULL)
+    output_dir = g_get_tmp_dir ();
 
   file = g_file_new_for_commandline_arg (basedir);
   add_test_for_file (file, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]