lib: add subtest extra command line option handling

At the moment any command line option handling done by tests will
interfere with the option handling of the subtest interface. To fix this
add a new version of the subtest_init function accepting optional short
and long command line options. Merge these together with the subtest
interface's own long options and handle both together in the same
getopt_long call.

Signed-off-by: Imre Deak <imre.deak@intel.com>
This commit is contained in:
Imre Deak
2013-08-03 02:10:11 +03:00
parent e55b89f1c3
commit 5cabaae4dd
2 changed files with 90 additions and 10 deletions
+7
View File
@@ -101,6 +101,13 @@ void igt_progress(const char *header, uint64_t i, uint64_t total);
/* subtest infrastructure */
jmp_buf igt_subtest_jmpbuf;
void igt_subtest_init(int argc, char **argv);
typedef int (*igt_opt_handler_t)(int opt, int opt_index);
struct option;
int igt_subtest_init_parse_opts(int argc, char **argv,
const char *extra_short_opts,
struct option *extra_long_opts,
const char *help_str,
igt_opt_handler_t opt_handler);
bool __igt_run_subtest(const char *subtest_name);
/**
* igt_subtest/_f - Denote a subtest code block