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

Petri Latvala petri.latvala at intel.com
Mon Jan 20 11:58:10 UTC 2020


On Fri, Jan 17, 2020 at 01:52:36PM +0000, Chris Wilson wrote:
> Quoting Zbigniew Kempczyński (2020-01-17 07:54:49)
> > 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_set. Currently it supports
> > iterating over set to get subsets, combinations and multicombinations.
> > Code has some limitation (set/subset cannot be larger than 16 elements,
> > what is enough for most cases).
> 
> I have to say, this looks like it is going to be very, very useful. All
> those times where I've used
> 	for_each_engine {
> 		for_each_engine {
> 		}
> 	}
> can be reduced to a standard combinatorial set, with igt_dynamic
> labelling thrown on top.
> 
> Petri, can you suggest how to write the selftests for igt? We definitely
> need a few to verify it works as expected and provide a few simple
> examples.


lib/tests/*.c

igt_audio.c and igt_edid.c are better examples than the ones testing
that the igt_magic_stuff macros works properly. They might also look a
bit familiar in structure...


-- 
Petri Latvala


More information about the igt-dev mailing list