From patchwork Thu Jul 31 15:30:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 4656741 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A86AAC0338 for ; Thu, 31 Jul 2014 15:30:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D8D3D20138 for ; Thu, 31 Jul 2014 15:30:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E2A64200E5 for ; Thu, 31 Jul 2014 15:30:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F3176E23C; Thu, 31 Jul 2014 08:30:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=87e5P0TPt3ejI3+pB6fC7RBFakQ3d7H/C7JBFrcKZzI=; b=Bc5lOCFxGKLAYAUyX+0mOvxnC6taRFAbNRjoVqdVbfDfBaZd/IrIC6ub22GRlzvbkJ RewYrtsmGsgaGgMW2i6KgE/xkDG+aSWfks4svgQSJc3A26DaMxlPVL7/E3FV1Td21Ldx heQ76lbGzslLic/KlKlNhspbKuJNdhWsU9bSQukvlHxOKUShou6MwrG77FMSPirhRWu2 c3YfMibFgfBKTxYCp+YIrorFQJVad/jWFE7GwRcPUy04PTAa6WyvocxuFrNaQalhzJzN UjK1VvgaL7W9cD+a3N/wwycycWzYu/7+/6NAWbRNaPsem4xkJyYB1BSZrMe333hBdu+6 xYQw== X-Gm-Message-State: ALoCoQnAZUgRGE6jwVh6ap5y4olCf6+qo4z81dA4vOaTBhI/bff5WbGCNMN2l8r/llzLSWMKFXCR X-Received: by 10.194.219.225 with SMTP id pr1mr18479952wjc.34.1406820638392; Thu, 31 Jul 2014 08:30:38 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ca8sm14133682wjc.0.2014.07.31.08.30.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jul 2014 08:30:37 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 31 Jul 2014 16:30:35 +0100 Message-Id: <1406820635-31640-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [Intel-gfx] [PATCH i-g-t] testdisplay: ignore invalid subtest options X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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':