All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] lib: add subtest start and exit status code messages to debug output
@ 2015-01-27 14:25 Thomas Wood
  2015-01-27 14:25 ` [PATCH i-g-t 2/2] lib: add exit status message to simple tests Thomas Wood
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Wood @ 2015-01-27 14:25 UTC (permalink / raw)
  To: intel-gfx

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index d74f6f8..41f84bb 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -729,6 +729,7 @@ bool __igt_run_subtest(const char *subtest_name)
 	}
 
 	kmsg(KERN_INFO "%s: starting subtest %s\n", command_str, subtest_name);
+	igt_debug("Starting subtest: %s\n", subtest_name);
 
 	gettime(&subtest_time);
 	return (in_subtest = subtest_name);
@@ -972,6 +973,7 @@ void igt_exit(void)
 		exit(IGT_EXIT_SUCCESS);
 
 	kmsg(KERN_INFO "%s: exiting, ret=%d\n", command_str, igt_exitcode);
+	igt_debug("Exiting with status code %d\n", igt_exitcode);
 
 	if (!test_with_subtests)
 		exit(igt_exitcode);
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH i-g-t 2/2] lib: add exit status message to simple tests
  2015-01-27 14:25 [PATCH i-g-t 1/2] lib: add subtest start and exit status code messages to debug output Thomas Wood
@ 2015-01-27 14:25 ` Thomas Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Wood @ 2015-01-27 14:25 UTC (permalink / raw)
  To: intel-gfx

Add an exit status message to simple tests, similar to the one printed
for subtests. This includes the test outcome and the time taken to run
the test.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_core.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 41f84bb..0ae6918 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -591,6 +591,9 @@ out:
 	/* install exit handler, to ensure we clean up */
 	igt_install_exit_handler(common_exit_handler);
 
+	if (!test_with_subtests)
+		gettime(&subtest_time);
+
 	return ret;
 }
 
@@ -975,8 +978,33 @@ void igt_exit(void)
 	kmsg(KERN_INFO "%s: exiting, ret=%d\n", command_str, igt_exitcode);
 	igt_debug("Exiting with status code %d\n", igt_exitcode);
 
-	if (!test_with_subtests)
+	if (!test_with_subtests) {
+		struct timespec now;
+		double elapsed;
+		const char *result;
+
+		gettime(&now);
+		elapsed = now.tv_sec - subtest_time.tv_sec;
+		elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9;
+
+		switch (igt_exitcode) {
+			case IGT_EXIT_SUCCESS:
+				result = "SUCCESS";
+				break;
+			case IGT_EXIT_TIMEOUT:
+				result = "TIMEOUT";
+				break;
+			case IGT_EXIT_SKIP:
+				result = "SKIP";
+				break;
+			default:
+				result = "FAIL";
+		}
+
+
+		printf("%s (%.3fs)\n", result, elapsed);
 		exit(igt_exitcode);
+	}
 
 	/* Calling this without calling one of the above is a failure */
 	assert(skipped_one || succeeded_one || failed_one);
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-27 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 14:25 [PATCH i-g-t 1/2] lib: add subtest start and exit status code messages to debug output Thomas Wood
2015-01-27 14:25 ` [PATCH i-g-t 2/2] lib: add exit status message to simple tests Thomas Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.