[PATCH 4/7] tests/gem_caching: convert to use drmtest retval infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
---
 tests/gem_caching.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/tests/gem_caching.c b/tests/gem_caching.c
index d67bbf6..259662f 100644
--- a/tests/gem_caching.c
+++ b/tests/gem_caching.c
@@ -110,7 +110,6 @@ int main(int argc, char **argv)
 	int i, j;
 	uint8_t *cpu_ptr;
 	uint8_t *gtt_ptr;
-	bool skipped_all = true;
 
 	drmtest_subtest_init(argc, argv);
 	drmtest_skip_on_simulation();
@@ -145,9 +144,11 @@ int main(int argc, char **argv)
 	drmtest_init_aperture_trashers(bufmgr);
 	mappable_gtt_limit = gem_mappable_aperture_size();
 
-	if (drmtest_run_subtest("reads") && (flags & TEST_READ)) {
+	drmtest_subtest_block("reads") {
+		if (!(flags & TEST_READ))
+			drmtest_skip();
+
 		printf("checking partial reads\n");
-		skipped_all = false;
 
 		for (i = 0; i < ROUNDS; i++) {
 			uint8_t val0 = i;
@@ -173,9 +174,11 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (drmtest_run_subtest("writes") && (flags & TEST_WRITE)) {
+	drmtest_subtest_block("writes") {
+		if (!(flags & TEST_WRITE))
+			drmtest_skip();
+
 		printf("checking partial writes\n");
-		skipped_all = false;
 
 		for (i = 0; i < ROUNDS; i++) {
 			uint8_t val0 = i, val1;
@@ -223,9 +226,11 @@ int main(int argc, char **argv)
 		}
 	}
 
-	if (drmtest_run_subtest("read-writes") && (flags & TEST_BOTH) == TEST_BOTH) {
+	drmtest_subtest_block("read-writes") {
+		if (!((flags & TEST_BOTH) == TEST_BOTH))
+			drmtest_skip();
+
 		printf("checking partial writes after partial reads\n");
-		skipped_all = false;
 
 		for (i = 0; i < ROUNDS; i++) {
 			uint8_t val0 = i, val1, val2;
@@ -299,5 +304,5 @@ int main(int argc, char **argv)
 
 	close(fd);
 
-	return skipped_all ? 77 : 0;
+	return drmtest_retval();
 }
-- 
1.8.3.2

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux