From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] runner/resultgen: Handle empty outputs
Date: Fri, 11 Oct 2019 14:52:55 +0300 [thread overview]
Message-ID: <20191011115255.15720-1-petri.latvala@intel.com> (raw)
If an output (out.txt or err.txt) is completely empty, we handle the
parsing just fine as is, but we end up assuming that if journal says
we have a subtest, that subtest printed that it started. We have one
case where out.txt was empty and all other files were intact (ran out
of disk?)
All other paths that expect certain texts handle failures finding them
properly apart from subtest result processing, which happily passed
along a NULL pointer as a string to json. After handling that case,
the processing of said weird case proceeded fine and produced correct
results.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
runner/resultgen.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 58b95220..46c9d8d5 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -268,8 +268,9 @@ static struct json_object *get_or_create_json_object(struct json_object *base,
static void set_result(struct json_object *obj, const char *result)
{
- json_object_object_add(obj, "result",
- json_object_new_string(result));
+ if (result)
+ json_object_object_add(obj, "result",
+ json_object_new_string(result));
}
static void add_runtime(struct json_object *obj, double time)
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2019-10-11 11:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 11:52 Petri Latvala [this message]
2019-10-11 12:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for runner/resultgen: Handle empty outputs Patchwork
2019-10-11 12:26 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
2019-10-11 13:00 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-10-11 18:27 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191011115255.15720-1-petri.latvala@intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox