From: Thomas Wood Subject: [PATCH i-g-t] testdisplay: ignore invalid subtest options Date: Thu, 31 Jul 2014 16:30:35 +0100 Message-ID: <1406820635-31640-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-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by gabe.freedesktop.org (Postfix) with ESMTP id E85246E23C for ; Thu, 31 Jul 2014 08:30:42 -0700 (PDT) Received: by mail-wi0-f182.google.com with SMTP id d1so4353654wiv.15 for ; Thu, 31 Jul 2014 08:30:39 -0700 (PDT) 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 List-Id: intel-gfx@lists.freedesktop.org testdisplay does not have any subtests and should therefore exit with the appropriate exit code if the --list-subtests or --run-subtest options are used. Signed-off-by: Thomas Wood --- tests/testdisplay.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index a187c16..f26d942 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -71,6 +71,8 @@ #include #include +#define SUBTEST_OPTS 1 + static int tio_fd; struct termios saved_tio; @@ -748,12 +750,17 @@ int main(int argc, char **argv) GMainLoop *mainloop; float force_clock; bool opt_dump_info = false; + struct option long_opts[] = { + {"list-subtests", 0, 0, SUBTEST_OPTS}, + {"run-subtest", 1, 0, SUBTEST_OPTS}, + { 0, 0, 0, 0 } + }; igt_skip_on_simulation(); enter_exec_path( argv ); - while ((c = getopt(argc, argv, optstr)) != -1) { + while ((c = getopt_long(argc, argv, optstr, long_opts, NULL)) != -1) { switch (c) { case '3': test_stereo_modes = 1; @@ -804,6 +811,10 @@ int main(int argc, char **argv) case 'o': sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num); break; + case SUBTEST_OPTS: + /* invalid subtest options */ + exit(IGT_EXIT_INVALID); + break; default: /* fall through */ case 'h': -- 1.9.3