diff options
author | Paul Kocialkowski <paul.kocialkowski@linux.intel.com> | 2017-07-19 16:46:07 +0300 |
---|---|---|
committer | Lyude <lyude@redhat.com> | 2017-07-19 12:04:21 -0400 |
commit | ee31e0b539c63bb52137f0585605dad3a700a7c0 (patch) | |
tree | 6d22e42b884988e8227544159b92b2aeaede3235 /lib/igt_core.c | |
parent | 7422d7540a3b9f3b46be1806c96589eaefe7cff3 (diff) |
Introduce common frame dumping configuration and helpers
This introduces a common FrameDumpPath configuration field, as well as
helper functions in dedicated igt_frame for writing cairo surfaces
to png files.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Reviewed-by: Lyude <lyude@redhat.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 1ba79361..5a3b00e8 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -235,6 +235,10 @@ * An example configuration follows: * * |[<!-- language="plain" --> + * # The common configuration secton follows. + * [Common] + * FrameDumpPath=/tmp # The path to dump frames that fail comparison checks + * * # The following section is used for configuring the Device Under Test. * # It is not mandatory and allows overriding default values. * [DUT] @@ -290,6 +294,7 @@ static struct { static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER; GKeyFile *igt_key_file; +char *frame_dump_path; const char *igt_test_name(void) { @@ -621,6 +626,13 @@ static int config_parse(void) if (!igt_key_file) return 0; + frame_dump_path = getenv("IGT_FRAME_DUMP_PATH"); + + if (!frame_dump_path) + frame_dump_path = g_key_file_get_string(igt_key_file, "Common", + "FrameDumpPath", + &error); + rc = g_key_file_get_integer(igt_key_file, "DUT", "SuspendResumeDelay", &error); if (error && error->code == G_KEY_FILE_ERROR_INVALID_VALUE) |