Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>,
	Martin Peres <martin.peres@linux.intel.com>
Subject: [igt-dev] [PATCH i-g-t 1/4] lib: Print subtest starting/ending line to stderr too
Date: Mon, 30 Apr 2018 12:28:45 +0300	[thread overview]
Message-ID: <20180430092848.10830-2-petri.latvala@intel.com> (raw)
In-Reply-To: <20180430092848.10830-1-petri.latvala@intel.com>

when instructed via the environment. This is needed for the new test
runner to properly assign stderr output to the correct subtest.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Martin Peres <martin.peres@linux.intel.com>
---
 lib/igt_core.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 5092a3f0..da149c10 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -305,6 +305,8 @@ GKeyFile *igt_key_file;
 
 char *igt_frame_dump_path;
 
+static bool stderr_needs_sentinel = false;
+
 const char *igt_test_name(void)
 {
 	return command_str;
@@ -649,6 +651,8 @@ static void common_init_env(void)
 	}
 
 	igt_frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
+
+	stderr_needs_sentinel = getenv("IGT_SENTINEL_ON_STDERR") != NULL;
 }
 
 static int common_init(int *argc, char **argv,
@@ -932,7 +936,10 @@ bool __igt_run_subtest(const char *subtest_name)
 
 	igt_kmsg(KMSG_INFO "%s: starting subtest %s\n",
 		 command_str, subtest_name);
-	igt_debug("Starting subtest: %s\n", subtest_name);
+	igt_info("Starting subtest: %s\n", subtest_name);
+	fflush(stdout);
+	if (stderr_needs_sentinel)
+		fprintf(stderr, "Starting subtest: %s\n", subtest_name);
 
 	_igt_log_buffer_reset();
 
@@ -987,6 +994,9 @@ static void exit_subtest(const char *result)
 		 in_subtest, result, time_elapsed(&subtest_time, &now),
 		 (!__igt_plain_output) ? "\x1b[0m" : "");
 	fflush(stdout);
+	if (stderr_needs_sentinel)
+		fprintf(stderr, "Subtest %s: %s (%.3fs)\n",
+			in_subtest, result, time_elapsed(&subtest_time, &now));
 
 	igt_terminate_spin_batches();
 
-- 
2.14.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-04-30  9:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30  9:28 [igt-dev] [PATCH i-g-t 0/4] New runner to rule them all Petri Latvala
2018-04-30  9:28 ` Petri Latvala [this message]
2018-04-30  9:28 ` [igt-dev] [PATCH i-g-t 2/4] uwildmat: Case-insensitive test selection Petri Latvala
2018-04-30  9:28 ` [igt-dev] [PATCH i-g-t 3/4] runner: New test runner Petri Latvala
2018-05-03 12:04   ` Arkadiusz Hiler
2018-05-04 13:45   ` Arkadiusz Hiler
2018-05-07 18:34   ` Daniel Vetter
2018-05-24  8:40     ` Petri Latvala
2018-05-08  8:47   ` Arkadiusz Hiler
2018-05-08  8:50     ` Chris Wilson
2018-05-11 10:45   ` Arkadiusz Hiler
2018-05-11 10:50     ` Chris Wilson
2018-05-11 10:51       ` Chris Wilson
2018-04-30  9:28 ` [igt-dev] [PATCH i-g-t 4/4] runner: Unit tests for the runner Petri Latvala
2018-04-30 14:54 ` [igt-dev] ✓ Fi.CI.BAT: success for New runner to rule them all Patchwork
2018-04-30 20:13 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-05-11 11:24 ` [igt-dev] [PATCH i-g-t 0/4] " David Weinehall
2018-06-04 22:17 ` Eric Anholt

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=20180430092848.10830-2-petri.latvala@intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@linux.intel.com \
    --cc=tomi.p.sarvela@intel.com \
    /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