summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-03-03 10:47:45 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2018-03-08 18:06:29 +0000
commitf99bb91cb09c047ec3b5dda3bc5b7e49b14b00a3 (patch)
tree5547839d7fccfabe35982dacad43a0a4d00bea43
parent289202e876688338f439ded7613804ee67034e91 (diff)
igt/drv_hangman: Check that the error state does hold the expected state
Actually check the error state exists (!"No error state captured") and that it contains the expected engine dump. v2: Throw in some debug clues. v3: Fail if the file doesn't exist, or empty. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
-rw-r--r--tests/drv_hangman.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index 38cb20c3..1736d2a6 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -129,6 +129,14 @@ static void check_error_state(const char *expected_ring_name,
FILE *file = open_error();
char *line = NULL;
size_t line_size = 0;
+ bool found = false;
+
+ igt_debug("%s(expected ring name=%s, expected offset=%"PRIx64")\n",
+ __func__, expected_ring_name, expected_offset);
+ igt_debugfs_dump(device, "i915_error_state");
+
+ igt_assert(getline(&line, &line_size, file) != -1);
+ igt_assert(strcasecmp(line, "No error state collected"));
while (getline(&line, &line_size, file) > 0) {
char *dashes;
@@ -168,12 +176,18 @@ static void check_error_state(const char *expected_ring_name,
4*i, batch[i]);
igt_assert(strstr(line, expected_line));
}
+
+ found = true;
break;
}
}
free(line);
fclose(file);
+
+ clear_error_state();
+
+ igt_assert(found);
}
static void test_error_state_capture(unsigned ring_id,