[igt-dev] [PATCH i-g-t v4] lib/igt_collection: Adding combinatorics facility

Petri Latvala petri.latvala at intel.com
Wed Jan 22 10:17:23 UTC 2020


On Tue, Jan 21, 2020 at 05:10:47PM +0100, Zbigniew Kempczyński wrote:
> Dynamic tests gives us new method to create tests depending on the
> hardware/software capabilities. To check coverage some tests require
> verification over some set of objects/data. To make life easier
> with combinatorics this patch introduces igt_collection. Currently it
> supports iterating over set to get subsets, combinations, variations
> with and without repetitions.
> Code has some limitation (set/subset cannot be larger than 16 elements,
> what is enough for most cases).
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Petri Latvala <petri.latvala at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  .../igt-gpu-tools/igt-gpu-tools-docs.xml      |   1 +
>  lib/Makefile.sources                          |   2 +
>  lib/igt_collection.c                          | 515 ++++++++++++++++++
>  lib/igt_collection.h                          |  99 ++++
>  lib/meson.build                               |   1 +
>  5 files changed, 618 insertions(+)
>  create mode 100644 lib/igt_collection.c
>  create mode 100644 lib/igt_collection.h
> 
> diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> index aa9fef20..9c9aa8f1 100644
> --- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> +++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> @@ -20,6 +20,7 @@
>      <xi:include href="xml/igt_audio.xml"/>
>      <xi:include href="xml/igt_aux.xml"/>
>      <xi:include href="xml/igt_chamelium.xml"/>
> +    <xi:include href="xml/igt_collection.xml"/>
>      <xi:include href="xml/igt_core.xml"/>
>      <xi:include href="xml/igt_debugfs.xml"/>
>      <xi:include href="xml/igt_device.xml"/>
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index feb8c20d..631d6714 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -29,6 +29,8 @@ lib_source_list =	 	\
>  	igt_device_scan.h	\
>  	igt_aux.c		\
>  	igt_aux.h		\
> +	igt_collection.c	\
> +	igt_collection.h	\
>  	igt_color_encoding.c	\
>  	igt_color_encoding.h	\
>  	igt_edid.c		\
> diff --git a/lib/igt_collection.c b/lib/igt_collection.c
> new file mode 100644
> index 00000000..c3e585c7
> --- /dev/null
> +++ b/lib/igt_collection.c
> @@ -0,0 +1,515 @@
> +#include "igt.h"
> +#include "igt_collection.h"


This file is still missing the license comment block.



-- 
Petri Latvala


More information about the igt-dev mailing list