public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
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 2/3] runner: Refactor abort-checking to a helper function
Date: Thu, 26 Jan 2023 12:53:37 +0200	[thread overview]
Message-ID: <20230126105338.419418-3-petri.latvala@intel.com> (raw)
In-Reply-To: <20230126105338.419418-1-petri.latvala@intel.com>

Abort-condition checking at runtime will later use the helper
differently.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arek@hiler.eu>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 runner/executor.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 9d3623b4..5b4e84d1 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -348,21 +348,21 @@ static const struct {
 	{ 0, 0 },
 };
 
-static char *need_to_abort(const struct settings* settings)
+static char *_need_to_abort(int abort_mask, int log_level)
 {
 	typeof(*abort_handlers) *it;
 
 	for (it = abort_handlers; it->condition; it++) {
 		char *abort;
 
-		if (!(settings->abort_mask & it->condition))
+		if (!(abort_mask & it->condition))
 			continue;
 
 		abort = it->handler();
 		if (!abort)
 			continue;
 
-		if (settings->log_level >= LOG_LEVEL_NORMAL)
+		if (log_level >= LOG_LEVEL_NORMAL)
 			errf("Aborting: %s\n", abort);
 
 		return abort;
@@ -371,6 +371,11 @@ static char *need_to_abort(const struct settings* settings)
 	return NULL;
 }
 
+static char *need_to_abort(const struct settings *settings)
+{
+	return _need_to_abort(settings->abort_mask, settings->log_level);
+}
+
 static void prune_subtest(struct job_list_entry *entry, const char *subtest)
 {
 	char *excl;
-- 
2.30.2

  parent reply	other threads:[~2023-01-26 10:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 10:53 [igt-dev] [PATCH i-g-t 0/3] runner: Using 'abort' as test result instead of a separate test Petri Latvala
2023-01-26 10:53 ` [igt-dev] [PATCH i-g-t 1/3] runner: Don't override more results than requested Petri Latvala
2023-01-26 10:53 ` Petri Latvala [this message]
2023-01-26 10:53 ` [igt-dev] [PATCH i-g-t 3/3] runner: Use 'abort' as result if a test caused an abort Petri Latvala
2023-01-26 11:43 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Using 'abort' as test result instead of a separate test Patchwork
2023-01-26 13:12 ` [igt-dev] [PATCH i-g-t 0/3] " Kamil Konieczny
2023-01-26 13:42   ` Petri Latvala
2023-01-26 17:47 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2023-01-27 11:01   ` Petri Latvala
2023-01-29  9:21     ` Yedireswarapu, SaiX Nandan
2023-01-27 13:27 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20230126105338.419418-3-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