[PATCH i-g-t v2 2/3] tests/core_getversion: print version info

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Wed Mar 13 13:58:19 UTC 2024


On Wed, 21 Feb 2024 11:29:28 +0100
Kamil Konieczny <kamil.konieczny at linux.intel.com> wrote:

> Add printing of version information to basic subtest.
> 
> Cc: Helen Koike <helen.koike at collabora.com>
> Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

LGTM.
Reviewed-by: Mauro Carvalho Chehab <mchehab at kernel.org>

> ---
>  tests/core_getversion.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/core_getversion.c b/tests/core_getversion.c
> index 6ec223eef..8b95e2ce4 100644
> --- a/tests/core_getversion.c
> +++ b/tests/core_getversion.c
> @@ -45,7 +45,7 @@
>  IGT_TEST_DESCRIPTION("Tests the DRM_IOCTL_GET_VERSION ioctl and libdrm's "
>  		     "drmGetVersion() interface to it.");
>  
> -static void check(int fd)
> +static void check(int fd, char *dst, int len)
>  {
>  	drmVersionPtr v;
>  
> @@ -56,11 +56,15 @@ static void check(int fd)
>  	if (is_i915_device(fd))
>  		igt_assert_lte(1, v->version_major);
>  
> +	snprintf(dst, len, "%s v%d.%d %s %s", v->name, v->version_major,
> +		v->version_minor, v->date, v->desc);
> +	dst[len - 1] = 0;
>  	drmFree(v);
>  }
>  
>  igt_main
>  {
> +	char info[256];
>  	int fd;
>  
>  	igt_fixture {
> @@ -69,8 +73,10 @@ igt_main
>  	}
>  
>  	igt_describe("Check GET_VERSION ioctl of the first drm device.");
> -	igt_subtest("basic")
> -		check(fd);
> +	igt_subtest("basic") {
> +		check(fd, info, sizeof(info));
> +		igt_info("0: %s\n", info);
> +	}
>  
>  	igt_fixture
>  		drm_close_driver(fd);


More information about the igt-dev mailing list