Commit 9a621065 authored by Bastien Nocera's avatar Bastien Nocera

tests: Output reftest output in meson-logs

So that failed tests can have their data exported via the CI.
parent 23cba2ac
......@@ -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,16 @@ 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);
if (output_dir)
result = g_strconcat (output_dir, G_DIR_SEPARATOR_S, "..", G_DIR_SEPARATOR_S, "meson-logs", G_DIR_SEPARATOR_S, base, extension, NULL);
else
result = g_strconcat (g_get_tmp_dir (), G_DIR_SEPARATOR_S, base, extension, NULL);
g_free (base);
return result;
......@@ -578,6 +582,7 @@ 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");
file = g_file_new_for_commandline_arg (basedir);
add_test_for_file (file, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment