From patchwork Sat Mar 19 16:15:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 8625471 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A15CB9F54C for ; Sat, 19 Mar 2016 16:15:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B102E203ED for ; Sat, 19 Mar 2016 16:15:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7E49E203E6 for ; Sat, 19 Mar 2016 16:15:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E70346E0FB; Sat, 19 Mar 2016 16:15:42 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 702D66E0FB for ; Sat, 19 Mar 2016 16:15:39 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id r129so500645wmr.2 for ; Sat, 19 Mar 2016 09:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=LGkxxhq8V3OO7pxYrV85++i2xle1R7R+i9iB6AbkmtI=; b=I4XXnof6K7a3VQJwvL7l4KPxTM787AbvnZDMb7WTpFXaCncWu5SlsfFJ3Kwku+1+pj ekUrnrBlqlDmMjrVBJzaj3zssYiT/ygHc8KgtTHOmHidi7cktb+5BhhHfOPFEOgQ1zHZ b/596KjqKKnyPkbdG6QUn94+CwhSgJ/P9osIPmd3tRsN69Mtw793EkSiRwfWfcofe/Tu suDjzBY+9XS52zty+vdGM+pNeuqSFC6w9jzqLPd5ZZMwV2XRPtAJp08JIrgxb7DD7Og4 6BjPPnclkjcRDbGC2Aa5eJM8V0IfLzvabYZPBtzr7ZyemiGiku/JDa/gPHK7Y81sENuV xG0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=LGkxxhq8V3OO7pxYrV85++i2xle1R7R+i9iB6AbkmtI=; b=J0KaRrnhKfZzRUlDwRWnc/RsRtVUkBGWdgrlSLp7uStEuUTnepUrk8qFByV67pI6iu sbcDDwrInndB0avNqDEzFWbDJWua3y82weMS5Ly1MtqVX0ioVd4CYTXPIWW08OruEW7j 0q/Xz8/6luh3zrkV/qpy6v4mnPcp5fWqBl7hro3ZE7upRqIAfCpnVHNN/2fI+fS5mfXo CdcQZVKLd63iRpIyYOsT890KStIY+zqRVbe4HcMMZG8Db5dH3s7yh4JQ4KGrK8Z8OSp0 n2vr97EYwECGs6yW1ER1d45n4kjUSCjVilYnweoRZ0bYQP4Cd8Rm9BeyavBGI0ODQ6B/ teyw== X-Gm-Message-State: AD7BkJJrFQEUkuoBfQAe7uQCZlEkjcLaRxkKfjKzdVPSxbKWchsggkAGmKs1T8JSCmhXLA== X-Received: by 10.194.90.100 with SMTP id bv4mr21275143wjb.4.1458404137497; Sat, 19 Mar 2016 09:15:37 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id a10sm17050109wjb.38.2016.03.19.09.15.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 19 Mar 2016 09:15:36 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sat, 19 Mar 2016 16:15:29 +0000 Message-Id: <1458404129-17293-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.0.rc3 Subject: [Intel-gfx] [PATCH igt] lib/core: Add option to exit on first failure X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 When bisecting a test failure (one of many possibile subtests), we want to exit as early as possible after the first subtest fails. Signed-off-by: Chris Wilson --- lib/igt_core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index ad79498..a7d6766 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -231,6 +231,7 @@ const char *igt_interactive_debug; /* subtests helpers */ static bool list_subtests = false; +static bool kill_on_fail = false; static char *run_single_subtest = NULL; static bool run_single_subtest_found = false; static const char *in_subtest = NULL; @@ -258,6 +259,7 @@ enum { OPT_DESCRIPTION, OPT_DEBUG, OPT_INTERACTIVE_DEBUG, + OPT_KILL = 'k', OPT_HELP = 'h' }; @@ -585,11 +587,12 @@ static int common_init(int *argc, char **argv, {"help-description", 0, 0, OPT_DESCRIPTION}, {"debug", optional_argument, 0, OPT_DEBUG}, {"interactive-debug", optional_argument, 0, OPT_INTERACTIVE_DEBUG}, + {"kill", 0, 0, OPT_KILL}, {"help", 0, 0, OPT_HELP}, {0, 0, 0, 0} }; char *short_opts; - const char *std_short_opts = "h"; + const char *std_short_opts = "kh"; struct option *combined_opts; int extra_opt_count; int all_opt_count; @@ -700,6 +703,9 @@ static int common_init(int *argc, char **argv, print_test_description(); ret = -1; goto out; + case OPT_KILL: + kill_on_fail = true; + break; case OPT_HELP: print_usage(help_str, false); ret = -1; @@ -1148,6 +1154,8 @@ void igt_fail(int exitcode) exit_subtest("TIMEOUT"); else exit_subtest("FAIL"); + if (kill_on_fail) + igt_exit(); } else { assert(!test_with_subtests || in_fixture);