diff options
author | Thomas Wood <thomas.wood@intel.com> | 2014-07-23 10:38:24 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2014-07-23 15:23:54 +0100 |
commit | 561d519e67f31c81d338601ce859d32188c4bd7b (patch) | |
tree | 21a9dba02889934bfb0d6937e0d3d13f6b1bf57e /lib/igt_core.c | |
parent | c584d5c671fd81881e39b032771398cf705b4bf4 (diff) |
lib: add a command line option to enable debug output in tests
Add --debug as a common command line option for all tests to enable
debug output.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 42b22fc1..d90e6bbb 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -276,7 +276,9 @@ static void print_usage(const char *command_str, const char *help_str, fprintf(f, "Usage: %s [OPTIONS]\n" " --list-subtests\n" - " --run-subtest <pattern>\n", command_str); + " --run-subtest <pattern>\n" + " --debug\n" + " --help\n", command_str); if (help_str) fprintf(f, "%s\n", help_str); } @@ -301,6 +303,7 @@ static int common_init(int argc, char **argv, static struct option long_options[] = { {"list-subtests", 0, 0, 'l'}, {"run-subtest", 1, 0, 'r'}, + {"debug", 0, 0, 'd'}, {"help", 0, 0, 'h'}, }; const char *command_str; @@ -349,6 +352,9 @@ static int common_init(int argc, char **argv, while ((c = getopt_long(argc, argv, short_opts, combined_opts, &option_index)) != -1) { switch(c) { + case 'd': + igt_log_level = IGT_LOG_DEBUG; + break; case 'l': if (!run_single_subtest) list_subtests = true; |