igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/5] lib: Print subtest starting/ending line to stderr too
Date: Wed,  8 Aug 2018 14:06:57 +0300	[thread overview]
Message-ID: <20180808110701.12619-2-petri.latvala@intel.com> (raw)
In-Reply-To: <20180808110701.12619-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.

v2:
 Print the subtest result from skip_subtests_henceforth handling also
 to stderr.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_core.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 5e6fb7ad..d3385756 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -301,6 +301,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;
@@ -643,6 +645,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,
@@ -919,12 +923,20 @@ bool __igt_run_subtest(const char *subtest_name)
 		       (!__igt_plain_output) ? "\x1b[1m" : "", subtest_name,
 		       skip_subtests_henceforth == SKIP ?
 		       "SKIP" : "FAIL", (!__igt_plain_output) ? "\x1b[0m" : "");
+		fflush(stdout);
+		if (stderr_needs_sentinel)
+			fprintf(stderr, "Subtest %s: %s\n", subtest_name,
+				skip_subtests_henceforth == SKIP ?
+				"SKIP" : "FAIL");
 		return false;
 	}
 
 	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();
 
@@ -979,6 +991,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-08-08 11:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 11:06 [igt-dev] [PATCH i-g-t 0/5] New test runner to rule them all, v3 Petri Latvala
2018-08-08 11:06 ` Petri Latvala [this message]
2018-08-08 11:17   ` [igt-dev] [PATCH i-g-t 1/5] lib: Print subtest starting/ending line to stderr too Chris Wilson
2018-08-08 11:28     ` Petri Latvala
2018-08-08 11:06 ` [igt-dev] [PATCH i-g-t 2/5] lib: Export igt_gettime and igt_time_elapsed Petri Latvala
2018-08-08 11:06 ` [igt-dev] [PATCH i-g-t 3/5] uwildmat: Case-insensitive test selection Petri Latvala
2018-08-08 11:07 ` [igt-dev] [PATCH i-g-t v3 4/5] runner: New test runner Petri Latvala
2018-08-08 11:07 ` [igt-dev] [PATCH i-g-t v4 5/5] runner: Unit tests for the runner Petri Latvala
2018-08-08 11:18 ` [igt-dev] [PATCH i-g-t 0/5] New test runner to rule them all, v3 Arkadiusz Hiler
2018-08-08 12:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-08-08 17:35 ` [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=20180808110701.12619-2-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;
as well as URLs for NNTP newsgroup(s).