lib/drmtest: subtest infrastructure

To make these helpers as least invasive as possible simply initialize
the options with a getopt parser and let the control flow be steered
with a simple helper which gets the subtest name as an argument.

The only tricky part for using it is that the subtest check helper
doubles up as the conduit to enumerate tests (and in that mode
prevents any test from being run). It is therefore important that
nothing gets printed to stdout outside of these checks.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter
2012-11-27 20:03:25 +01:00
parent 021909e10d
commit 9fc7e1386a
2 changed files with 63 additions and 0 deletions
+3
View File
@@ -84,6 +84,9 @@ void drmtest_permute_array(void *array, unsigned size,
unsigned i,
unsigned j));
void drmtest_progress(const char *header, uint64_t i, uint64_t total);
void drmtest_subtest_init(int argc, char **argv);
bool drmtest_run_subtest(const char *subtest_name);
bool drmtest_only_list_subtests(void);
/* helpers based upon the libdrm buffer manager */
void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr);