All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniels@collabora.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_getfb: Use fixtures and subtest groups
Date: Fri, 30 Mar 2018 16:49:39 +0100	[thread overview]
Message-ID: <20180330154939.20647-1-daniels@collabora.com> (raw)

Make sure we gently skip when required features (CCS, getfb2) are not
supported on the running kernel, and clean up properly after ourselves.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 tests/kms_getfb.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/kms_getfb.c b/tests/kms_getfb.c
index 5f0bd2a9..81d796a4 100644
--- a/tests/kms_getfb.c
+++ b/tests/kms_getfb.c
@@ -102,7 +102,7 @@ static void test_handle_input(int fd)
 		add.pitches[0] = 1024*4;
 		add.handles[0] = igt_create_bo_with_dimensions(fd, 1024, 1024,
 			DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL);
-		igt_assert(add.handles[0]);
+		igt_require(add.handles[0] != 0);
 		do_ioctl(fd, DRM_IOCTL_MODE_ADDFB2, &add);
 	}
 
@@ -134,6 +134,9 @@ static void test_handle_input(int fd)
 		igt_require(get.fb_id > 0);
 		do_ioctl_err(fd, DRM_IOCTL_MODE_GETFB, &get, ENOENT);
 	}
+
+	igt_fixture
+		gem_close(fd, add.handles[0]);
 }
 
 static void test_duplicate_handles(int fd)
@@ -198,9 +201,11 @@ igt_main
 	igt_fixture
 		fd = drm_open_driver_master(DRIVER_ANY);
 
-	test_handle_input(fd);
+	igt_subtest_group
+		test_handle_input(fd);
 
-	test_duplicate_handles(fd);
+	igt_subtest_group
+		test_duplicate_handles(fd);
 
 	igt_fixture
 		close(fd);
-- 
2.17.0.rc1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2018-03-30 15:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 15:49 Daniel Stone [this message]
2018-03-30 16:46 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_getfb: Use fixtures and subtest groups Patchwork
2018-03-30 17:47 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
2018-03-30 18:20   ` Daniel Stone
2018-03-30 21:01 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
2018-04-02 13:02   ` Daniel Stone
2018-04-02 17:13     ` Antonio Argenziano
2018-04-04 14:00       ` Arkadiusz Hiler
2018-04-04 16:28         ` Daniel Stone
2018-04-05  9:18           ` Arkadiusz Hiler
2018-04-05  8:44       ` Daniel Vetter

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=20180330154939.20647-1-daniels@collabora.com \
    --to=daniels@collabora.com \
    --cc=igt-dev@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 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.