From: Thomas Wood <thomas.wood@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 2/8] lib: highlight subtest results on terminals
Date: Mon, 2 Nov 2015 11:48:38 +0000 [thread overview]
Message-ID: <1446464924-20878-2-git-send-email-thomas.wood@intel.com> (raw)
In-Reply-To: <1446464924-20878-1-git-send-email-thomas.wood@intel.com>
Make subtest results easier to identify by making them bold when the output
is a terminal.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
lib/igt_core.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 59127ca..7123455 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -779,9 +779,12 @@ bool __igt_run_subtest(const char *subtest_name)
}
if (skip_subtests_henceforth) {
- printf("Subtest %s: %s\n", subtest_name,
+ bool istty = isatty(STDOUT_FILENO);
+
+ printf("%sSubtest %s: %s%s\n",
+ (istty) ? "\x1b[1m" : "", subtest_name,
skip_subtests_henceforth == SKIP ?
- "SKIP" : "FAIL");
+ "SKIP" : "FAIL", (istty) ? "\x1b[0m" : "");
return false;
}
@@ -825,12 +828,14 @@ static void exit_subtest(const char *result)
{
struct timespec now;
double elapsed;
+ bool istty = isatty(STDOUT_FILENO);
gettime(&now);
elapsed = now.tv_sec - subtest_time.tv_sec;
elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9;
- printf("Subtest %s: %s (%.3fs)\n", in_subtest, result, elapsed);
+ printf("%sSubtest %s: %s (%.3fs)%s\n", (istty) ? "\x1b[1m" : "",
+ in_subtest, result, elapsed, (istty) ? "\x1b[0m" : "");
fflush(stdout);
in_subtest = NULL;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-02 11:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 11:48 [PATCH i-g-t 1/8] kms_force_connector: use comparison macros to make debug output clearer Thomas Wood
2015-11-02 11:48 ` Thomas Wood [this message]
2015-11-04 19:58 ` [PATCH i-g-t 2/8] lib: highlight subtest results on terminals Paulo Zanoni
2015-11-05 15:32 ` Morton, Derek J
2015-11-09 17:17 ` [PATCH i-g-t] lib: add a environment variable to control output Thomas Wood
2015-11-09 20:58 ` Chris Wilson
2015-11-10 10:43 ` Thomas Wood
2015-11-11 10:09 ` Morton, Derek J
2015-11-02 11:48 ` [PATCH i-g-t 3/8] Add missing noreturn attribute to various functions Thomas Wood
2015-11-02 11:48 ` [PATCH i-g-t 4/8] tests: remove unnecessary igt_exit calls Thomas Wood
2015-11-02 11:48 ` [PATCH i-g-t 5/8] tests: remove duplicate struct member initializers Thomas Wood
2015-11-02 11:48 ` [PATCH i-g-t 6/8] Fix comparison of unsigned integers Thomas Wood
2015-11-02 11:48 ` [PATCH i-g-t 7/8] lib: add PIPE_ANY to the pipe enum Thomas Wood
2015-11-02 11:48 ` [PATCH i-g-t 8/8] tests/kms_fbc_crc: ensure context is initialized correctly Thomas Wood
2015-11-04 19:36 ` Zanoni, Paulo R
2015-11-04 20:00 ` Ville Syrjälä
2015-11-09 14:50 ` Thomas Wood
2015-11-02 17:13 ` [PATCH i-g-t 1/8] kms_force_connector: use comparison macros to make debug output clearer Thomas Wood
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=1446464924-20878-2-git-send-email-thomas.wood@intel.com \
--to=thomas.wood@intel.com \
--cc=intel-gfx@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