diff mbox

[17/22] flip_test: unify the name of the current test in status messages

Message ID 1350398096-3649-18-git-send-email-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Deak Oct. 16, 2012, 2:34 p.m. UTC
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/flip_test.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/tests/flip_test.c b/tests/flip_test.c
index 85fa0f2..a0c1e5d 100644
--- a/tests/flip_test.c
+++ b/tests/flip_test.c
@@ -84,6 +84,7 @@  struct event_state {
 };
 
 struct test_output {
+	const char *test_name;
 	uint32_t id;
 	int crtc_idx;
 	int mode_valid;
@@ -545,8 +546,8 @@  static void flip_mode(struct test_output *o, int duration)
 	if (!o->mode_valid)
 		return;
 
-	fprintf(stdout, "Beginning page flipping on crtc %d, connector %d\n",
-		crtc, o->id);
+	fprintf(stdout, "Beginning %s on crtc %d, connector %d\n",
+		o->test_name, crtc, o->id);
 
 	o->fb_width = o->mode.hdisplay;
 	o->fb_height = o->mode.vdisplay;
@@ -594,8 +595,8 @@  static void flip_mode(struct test_output *o, int duration)
 
 	check_final_state(o, &o->flip_state, ellapsed);
 
-	fprintf(stdout, "\npage flipping on crtc %d, connector %d: PASSED\n",
-		crtc, o->id);
+	fprintf(stdout, "\n%s on crtc %d, connector %d: PASSED\n\n",
+		o->test_name, crtc, o->id);
 
 	kmstest_remove_fb(drm_fd, o->fb_ids[1]);
 	kmstest_remove_fb(drm_fd, o->fb_ids[0]);
@@ -604,7 +605,7 @@  static void flip_mode(struct test_output *o, int duration)
 	drmModeFreeConnector(o->connector);
 }
 
-static int run_test(int duration, int flags)
+static int run_test(int duration, int flags, const char *test_name)
 {
 	struct test_output o;
 	int c, i;
@@ -620,6 +621,7 @@  static int run_test(int duration, int flags)
 	for (c = 0; c < resources->count_connectors; c++) {
 		for (i = 0; i < resources->count_crtcs; i++) {
 			memset(&o, 0, sizeof(o));
+			o.test_name = test_name;
 			o.id = resources->connectors[c];
 			o.flags = flags;
 			o.flip_state.name = "flip";
@@ -658,7 +660,7 @@  int main(int argc, char **argv)
 
 	for (i = 0; i < sizeof(tests) / sizeof (tests[0]); i++) {
 		printf("running testcase: %s\n", tests[i].name);
-		run_test(tests[i].duration, tests[i].flags);
+		run_test(tests[i].duration, tests[i].flags, tests[i].name);
 	}
 
 	close(drm_fd);