summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2019-05-31 12:56:19 +0300
committerPetri Latvala <petri.latvala@intel.com>2019-06-03 11:06:53 +0300
commitc998ca40a12933a0cefbe6b99c916eae32846919 (patch)
tree18a3e86469973fa15740a83eb874f3826ae5f05e /runner
parent1bcc155549ac1d99207321754c9942559e54bc99 (diff)
runner: Cope with repeated subtests in journal
As seen in fallout with the i915 engine discovery patchset, subtests can in very dire cases be entered multiple times, when the for loop they're in doesn't progress. That is of course a bug in IGT that needs to be fixed, but if (when) that happens again, don't make results take a million years to process. This patch has been tested to produce good results from the corresponding bad runs. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'runner')
-rw-r--r--runner/resultgen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 2b7d26d5..7b4cd519 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -742,6 +742,7 @@ static const char *result_from_exitcode(int exitcode)
static void add_subtest(struct subtests *subtests, char *subtest)
{
size_t len = strlen(subtest);
+ size_t i;
if (len == 0)
return;
@@ -749,6 +750,11 @@ static void add_subtest(struct subtests *subtests, char *subtest)
if (subtest[len - 1] == '\n')
subtest[len - 1] = '\0';
+ /* Don't add if we already have this subtest */
+ for (i = 0; i < subtests->size; i++)
+ if (!strcmp(subtest, subtests->names[i]))
+ return;
+
subtests->size++;
subtests->names = realloc(subtests->names, sizeof(*subtests->names) * subtests->size);
subtests->names[subtests->size - 1] = subtest;