Skip to contentSkip to conversation

tests: Sprinkle missing igt_exit() where needed.

PATCH In review root 2 participants 2 messages Oct 2, 2014

lore
Share & tools
lore

root

author
#0 lore raw

PATCH 1/1 tests: Sprinkle missing igt_exit() where needed.

From: Daniel Vetter <[email protected]>

Yay for breaking piles of tests.

This regression has been introduced with

commit 5782eca1e19e85a04ad402fa4094aa1b5f9c53ce

Author: Tim Gore <[email protected]>
Date:   Wed Oct 1 13:25:20 2014 +0100

lib/igt_core.c: disable lowmemorykiller during tests

---
 tests/gem_ctx_basic.c            | 2 +-
 tests/gem_exec_blt.c             | 2 +-
 tests/gem_gtt_speed.c            | 2 +-
 tests/gem_hang.c                 | 2 +-
 tests/gem_ppgtt.c                | 2 --
 tests/gem_render_copy.c          | 2 +-
 tests/gem_render_copy_redux.c    | 2 --
 tests/gem_render_linear_blits.c  | 2 +-
 tests/gem_render_tiled_blits.c   | 2 +-
 tests/gem_seqno_wrap.c           | 7 ++-----
 tests/gem_stress.c               | 2 +-
 tests/gem_userptr_blits.c        | 2 --
 tests/gen3_mixed_blits.c         | 2 +-
 tests/gen3_render_linear_blits.c | 2 +-
 tests/gen3_render_mixed_blits.c  | 2 +-
 tests/gen3_render_tiledx_blits.c | 2 +-
 tests/gen3_render_tiledy_blits.c | 2 +-
 tests/testdisplay.c              | 4 +++-
 18 files changed, 18 insertions(+), 25 deletions(-)
tests/gem_ctx_basic.c +1 -1
index a0bec602a911..b8b01c03e122 100644
@@ -166,5 +166,5 @@ int main(int argc, char *argv[])
 	free(threads);
 	close(fd);
 
-	return 0;
+	igt_exit();
 }
tests/gem_exec_blt.c +1 -1
index db997b335197..301c9397c590 100644
@@ -270,5 +270,5 @@ int main(int argc, char **argv)
 	} else
 		run(OBJECT_SIZE);
 
-	return 0;
+	igt_exit();
 }
tests/gem_gtt_speed.c +1 -1
index 5125078d36e8..c8581035653d 100644
@@ -329,5 +329,5 @@ int main(int argc, char **argv)
 	gem_close(fd, handle);
 	close(fd);
 
-	return 0;
+	igt_exit();
 }
tests/gem_hang.c +1 -1
index 7a7c8acbd84a..8767615c83ea 100644
@@ -93,5 +93,5 @@ int main(int argc, char **argv)
 
 	close(fd);
 
-	return 0;
+	igt_exit();
 }
tests/gem_ppgtt.c +0 -2
index 8c560f269601..0ee4f5b2a31e 100644
@@ -230,6 +230,4 @@ int main(int argc, char **argv)
 	}
 
 	igt_exit();
-
-	return 0;
 }
tests/gem_render_copy.c +1 -1
index 6ff0c776e5e4..094816c92143 100644
@@ -186,5 +186,5 @@ int main(int argc, char **argv)
 		scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10, SRC_COLOR);
 	}
 
-	return 0;
+	igt_exit();
 }
tests/gem_render_copy_redux.c +0 -2
index cb48aa73e6c3..6fc82df9a858 100644
@@ -241,6 +241,4 @@ int main(int argc, char **argv)
 	}
 
 	igt_exit();
-
-	return 0;
 }
tests/gem_render_linear_blits.c +1 -1
index 28fd8c8c482a..60ba83162d40 100644
@@ -200,5 +200,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, bo[i]->handle, start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gem_render_tiled_blits.c +1 -1
index ea1d59da8f07..dc22529c4d7e 100644
@@ -211,5 +211,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(batch, &buf[i], start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gem_seqno_wrap.c +2 -5
index e8528ec68575..6772d1e1436f 100644
@@ -527,10 +527,7 @@ int main(int argc, char **argv)
 			  options.dontwrap ? "tests" : "wraps", wcount);
 	}
 
-	if (options.rounds == wcount) {
-		igt_debug("done %d wraps successfully\n", wcount);
-		return 0;
-	}
+	igt_assert(options.rounds == wcount);
 
-	return r;
+	igt_exit();
 }
tests/gem_stress.c +1 -1
index 8d62b0357565..ab2cd0eb4656 100644
@@ -914,5 +914,5 @@ int main(int argc, char **argv)
 
 	igt_stop_signal_helper();
 
-	return 0;
+	igt_exit();
 }
tests/gem_userptr_blits.c +0 -2
index 638b74c29c24..a729f3191dae 100644
@@ -1443,6 +1443,4 @@ int main(int argc, char **argv)
 		test_access_control(fd);
 
 	igt_exit();
-
-	return 0;
 }
tests/gen3_mixed_blits.c +1 -1
index 33eea746cb4b..2d41cb4e2a88 100644
@@ -533,5 +533,5 @@ int main(int argc, char **argv)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_linear_blits.c +1 -1
index 7d4a228f4269..9bf9c306e2c1 100644
@@ -393,5 +393,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_mixed_blits.c +1 -1
index 1fe323c49ad7..bdfd66f6883e 100644
@@ -421,5 +421,5 @@ int main(int argc, char **argv)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_tiledx_blits.c +1 -1
index d8e2e87f852d..92a77f21ed5f 100644
@@ -400,5 +400,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_tiledy_blits.c +1 -1
index 1a819e564687..8927c0b4ef89 100644
@@ -407,5 +407,5 @@ int main(int argc, char **argv)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
 
-	return 0;
+	igt_exit();
 }
tests/testdisplay.c +3 -1
index a3cba44eb938..04e41db8e01a 100644
@@ -786,5 +786,7 @@ out_mainloop:
 out_close:
 	close(drm_fd);
 
-	return ret;
+	igt_assert(ret);
+
+	igt_exit();
 }
Signature · 1 line
1.9.3
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: root [mailto:[email protected]]
Sent: Thursday, October 02, 2014 10:36 AM
To: Intel Graphics Development
Cc: Daniel Vetter; Gore, Tim; Vetter, Daniel
Subject: [PATCH] tests: Sprinkle missing igt_exit() where needed.

Quoted 6 lines

From: Daniel Vetter <[email protected]>

Yay for breaking piles of tests.

This regression has been introduced with

Oops yes, this was my mistake. Forgot about the tests that use the igt init function but then just use return. Patch looks sensible, especially as this brings the single tests more into line with the multi-tests. I am very much in favour of this.

Tim

Quoted 243 lines

commit 5782eca1e19e85a04ad402fa4094aa1b5f9c53ce

Author: Tim Gore <[email protected]>
Date:   Wed Oct 1 13:25:20 2014 +0100

lib/igt_core.c: disable lowmemorykiller during tests

---
 tests/gem_ctx_basic.c            | 2 +-
 tests/gem_exec_blt.c             | 2 +-
 tests/gem_gtt_speed.c            | 2 +-
 tests/gem_hang.c                 | 2 +-
 tests/gem_ppgtt.c                | 2 --
 tests/gem_render_copy.c          | 2 +-
 tests/gem_render_copy_redux.c    | 2 --
 tests/gem_render_linear_blits.c  | 2 +-
 tests/gem_render_tiled_blits.c   | 2 +-
 tests/gem_seqno_wrap.c           | 7 ++-----
 tests/gem_stress.c               | 2 +-
 tests/gem_userptr_blits.c        | 2 --
 tests/gen3_mixed_blits.c         | 2 +-
 tests/gen3_render_linear_blits.c | 2 +-  tests/gen3_render_mixed_blits.c  |
2 +-  tests/gen3_render_tiledx_blits.c | 2 +-
tests/gen3_render_tiledy_blits.c | 2 +-
 tests/testdisplay.c              | 4 +++-
 18 files changed, 18 insertions(+), 25 deletions(-)
tests/gem_ctx_basic.c index renamed from tests/gem_ctx_basic.c +0 -0

a0bec602a911..b8b01c03e122 100644

tests/gem_ctx_basic.c +1 -1
@@ -166,5 +166,5 @@ int main(int argc, char *argv[])
 	free(threads);
 	close(fd);
 
-	return 0;
+	igt_exit();
 }
tests/gem_exec_blt.c index renamed from tests/gem_exec_blt.c +0 -0

db997b335197..301c9397c590 100644

tests/gem_exec_blt.c +1 -1
@@ -270,5 +270,5 @@ int main(int argc, char **argv)
 	} else
 		run(OBJECT_SIZE);
 
-	return 0;
+	igt_exit();
 }
tests/gem_gtt_speed.c index renamed from tests/gem_gtt_speed.c +0 -0

5125078d36e8..c8581035653d 100644

tests/gem_gtt_speed.c +1 -1
@@ -329,5 +329,5 @@ int main(int argc, char **argv)
 	gem_close(fd, handle);
 	close(fd);
 
-	return 0;
+	igt_exit();
 }
tests/gem_hang.c index renamed from tests/gem_hang.c +0 -0

7a7c8acbd84a..8767615c83ea 100644

tests/gem_hang.c +1 -1
@@ -93,5 +93,5 @@ int main(int argc, char **argv)
 
 	close(fd);
 
-	return 0;
+	igt_exit();
 }
tests/gem_ppgtt.c index renamed from tests/gem_ppgtt.c +0 -0

8c560f269601..0ee4f5b2a31e 100644

tests/gem_ppgtt.c +0 -2
@@ -230,6 +230,4 @@ int main(int argc, char **argv)
 	}
 
 	igt_exit();
-
-	return 0;
 }
tests/gem_render_copy.c index renamed from tests/gem_render_copy.c +0 -0

6ff0c776e5e4..094816c92143 100644

tests/gem_render_copy.c +1 -1
@@ -186,5 +186,5 @@ int main(int argc, char **argv)
 		scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10,
 SRC_COLOR);
 	}
 
-	return 0;
+	igt_exit();

}

(quoted diff) +0 -0

b/tests/gem_render_copy_redux.c index cb48aa73e6c3..6fc82df9a858 100644

tests/gem_render_copy_redux.c +0 -2
@@ -241,6 +241,4 @@ int main(int argc, char **argv)
 	}
 
 	igt_exit();
-
-	return 0;
 }
(quoted diff) +0 -0

b/tests/gem_render_linear_blits.c index 28fd8c8c482a..60ba83162d40 100644

tests/gem_render_linear_blits.c +1 -1
@@ -200,5 +200,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, bo[i]->handle, start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gem_render_tiled_blits.c +1 -1
index ea1d59da8f07..dc22529c4d7e 100644
@@ -211,5 +211,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(batch, &buf[i], start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gem_seqno_wrap.c index renamed from tests/gem_seqno_wrap.c +0 -0

e8528ec68575..6772d1e1436f 100644

tests/gem_seqno_wrap.c +2 -5
@@ -527,10 +527,7 @@ int main(int argc, char **argv)
 			  options.dontwrap ? "tests" : "wraps", wcount);
 	}
 
-	if (options.rounds == wcount) {
-		igt_debug("done %d wraps successfully\n", wcount);
-		return 0;
-	}
+	igt_assert(options.rounds == wcount);
 
-	return r;
+	igt_exit();
 }
tests/gem_stress.c index renamed from tests/gem_stress.c +0 -0

8d62b0357565..ab2cd0eb4656 100644

tests/gem_stress.c +1 -1
@@ -914,5 +914,5 @@ int main(int argc, char **argv)
 
 	igt_stop_signal_helper();
 
-	return 0;
+	igt_exit();
 }
tests/gem_userptr_blits.c index renamed from tests/gem_userptr_blits.c +0 -0

638b74c29c24..a729f3191dae 100644

tests/gem_userptr_blits.c +0 -2
@@ -1443,6 +1443,4 @@ int main(int argc, char **argv)
 		test_access_control(fd);
 
 	igt_exit();
-
-	return 0;
 }
tests/gen3_mixed_blits.c index renamed from tests/gen3_mixed_blits.c +0 -0

33eea746cb4b..2d41cb4e2a88 100644

tests/gen3_mixed_blits.c +1 -1
@@ -533,5 +533,5 @@ int main(int argc, char **argv)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_linear_blits.c +1 -1
index 7d4a228f4269..9bf9c306e2c1 100644
@@ -393,5 +393,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 
-	return 0;
+	igt_exit();
 }
(quoted diff) +0 -0

b/tests/gen3_render_mixed_blits.c index 1fe323c49ad7..bdfd66f6883e 100644

tests/gen3_render_mixed_blits.c +1 -1
@@ -421,5 +421,5 @@ int main(int argc, char **argv)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_tiledx_blits.c +1 -1
index d8e2e87f852d..92a77f21ed5f 100644
@@ -400,5 +400,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, handle[i], start_val[i]);
 
-	return 0;
+	igt_exit();
 }
tests/gen3_render_tiledy_blits.c +1 -1
index 1a819e564687..8927c0b4ef89 100644
@@ -407,5 +407,5 @@ int main(int argc, char **argv)
 		check_bo(fd, handle[i], start_val[i]);
 	igt_info("done\n");
 
-	return 0;
+	igt_exit();
 }
tests/testdisplay.c index renamed from tests/testdisplay.c +0 -0

a3cba44eb938..04e41db8e01a 100644

tests/testdisplay.c +3 -2
@@ -786,5 +786,7 @@ out_mainloop:
 out_close:
 	close(drm_fd);
 
-	return ret;
+	igt_assert(ret);
+
+	igt_exit();
 }
--

1.9.3