From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Wood Subject: [PATCH i-g-t 8/8] lib: add a command line option to enable debug output in tests Date: Wed, 23 Jul 2014 11:57:55 +0100 Message-ID: <1406113075-30860-9-git-send-email-thomas.wood@intel.com> References: <1406113075-30860-1-git-send-email-thomas.wood@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTP id AFF1B6E625 for ; Wed, 23 Jul 2014 03:58:09 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id bs8so7599945wib.3 for ; Wed, 23 Jul 2014 03:58:08 -0700 (PDT) In-Reply-To: <1406113075-30860-1-git-send-email-thomas.wood@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org Cc: daniel.vetter@ffwll.ch List-Id: intel-gfx@lists.freedesktop.org Add --debug as a common command line option for all tests to enable debug output. Signed-off-by: Thomas Wood --- lib/igt_core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 42b22fc..d90e6bb 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 \n", command_str); + " --run-subtest \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; -- 1.9.3