summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2021-01-25 15:55:14 +0200
committerPetri Latvala <petri.latvala@intel.com>2021-01-26 13:46:56 +0200
commit82fa6021821edb5d9609f4cce213920e0936d6f3 (patch)
tree9287a303a6fee8748e78a78a1f0dc250fd3a04a7 /runner
parentabef2b7d6ff30f3b948b3e5d39653debb73083f3 (diff)
runner: Fix graceful exit result parsing for dynamic subtests
Commit 10c83dfa5ad2 ("runner: Introduce a way to stop testing without marking tests incomplete") added graceful exiting by signaling the runner with SIGHUP, marking the currently running test as 'notrun' instead of 'incomplete'. The result handling didn't handle dynamic subtests though, so the currently executing dynamic subtest was still marked as 'incomplete'. Handle that now similarly as handling the 'abort' result. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arek@hiler.eu> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'runner')
-rw-r--r--runner/resultgen.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 8d0c6249..b74970a6 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -656,19 +656,24 @@ static void process_dynamic_subtest_output(const char *piglit_name,
dynend);
/*
- * If a dynamic subsubtest is considered incomplete we
- * need to check parent's status first, to be sure that
- * the binary hasn't aborted (exit code). If it has
- * aborted then we have to attribute this status to our
- * subsubtest.
+ * If a dynamic subsubtest is considered
+ * incomplete we need to check parent's status
+ * first, to be sure that the binary hasn't
+ * aborted or stopped gracefully (exit
+ * code). If it has aborted then we have to
+ * attribute this status to our subsubtest.
*/
if (!strcmp(dynresulttext, "incomplete")) {
struct json_object *parent_subtest;
if (json_object_object_get_ex(tests, piglit_name, &parent_subtest) &&
- json_object_object_get_ex(parent_subtest, "result", &parent_subtest) &&
- !strcmp(json_object_get_string(parent_subtest), "abort"))
- dynresulttext = "abort";
+ json_object_object_get_ex(parent_subtest, "result", &parent_subtest)) {
+ const char *resulttext = json_object_get_string(parent_subtest);
+
+ if (!strcmp(resulttext, "abort") ||
+ !strcmp(resulttext, "notrun"))
+ dynresulttext = resulttext;
+ }
}
set_result(current_dynamic_test, dynresulttext);