From patchwork Tue Feb 11 23:07:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3633321 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D9BA29F334 for ; Tue, 11 Feb 2014 23:08:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBDA6201ED for ; Tue, 11 Feb 2014 23:08:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D731A201F2 for ; Tue, 11 Feb 2014 23:08:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 773C3FABB3; Tue, 11 Feb 2014 15:08:02 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by gabe.freedesktop.org (Postfix) with ESMTP id DF989FABA8 for ; Tue, 11 Feb 2014 15:07:48 -0800 (PST) Received: by mail-ea0-f169.google.com with SMTP id h10so4070301eak.0 for ; Tue, 11 Feb 2014 15:07:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i6iBnSNi1+Bof+mRhCyonRH0h74iGcFlmpJAsWHXe/Q=; b=fu6RB4F+knxranDhdaqM1UuobsCY+MGMcSNk3sXxVP50fB6aFgosMNsEjlcyDjlCDw UbFkRNyd+AYZTfGwFSQQFBukQ+vqjPJFz2ITxb0Aqiq8te1mhcyQr6KSa6sUYm+FyWC2 1wfE1CRGFGg6TfxE9pIqW/ts/xKj4n7DarTbs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i6iBnSNi1+Bof+mRhCyonRH0h74iGcFlmpJAsWHXe/Q=; b=Ow5YuW/zuJwGHvDBy8w//dIiOLIyY/GaRbkFFLs1S5u95MtDq8uGVUM4WRvmm+FShC /AHDV/JzOw0XPh28hT01zZd1OC+w8uit20feKgJdLexFRPlwpkRG7yeVTKo/7UpnCxGw NqmujEHef0xrwCqlX1WraND1PIVwu7R7GPNogf9NuRmsX7Q1u+cYLcife30oRLRN6tVt ngRLMoCgO82zKDk5I+8aqktmIsTm8EFBijk6a9iZuHaec0V11A8b+jJWosxaELfiaJ1N Aoyb827ZXnA744EtX+1NDFywb3fO/Ym0LaIZdSqAjnFWlLos3V7mrt6gAb5CV2+2eUb3 BbFw== X-Gm-Message-State: ALoCoQn+Wuzt26h7UTpQnoCBGq3rTlCPKngBc2TkQbNnWH1VxMCuYc5DPPMZ+r5n8cXkfrlaa9ws X-Received: by 10.14.202.8 with SMTP id c8mr44560eeo.88.1392160067397; Tue, 11 Feb 2014 15:07:47 -0800 (PST) Received: from phenom.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id u6sm72875720eep.11.2014.02.11.15.07.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Feb 2014 15:07:46 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 12 Feb 2014 00:07:31 +0100 Message-Id: <1392160051-10998-7-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1392160051-10998-1-git-send-email-daniel.vetter@ffwll.ch> References: <1392160051-10998-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 7/7] lib: Make igt_skip noreturn X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 This is a remnant from the subtest code before we had proper fixture blocks. With those there's no no reason to have igt_skip calls outside of fixtures or subtests, so we can assert this and hence always jump out. Suggested by Thomas Wood since static analyzers got confused about this. To check for fallout I've run all tests as non-root so that they'll all skip. Only very little fallout resulted. Cc: Thomas Wood Signed-off-by: Daniel Vetter --- lib/drmtest.c | 4 ++-- lib/drmtest.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index f6e6ccbee84a..46227c35cc8f 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1027,8 +1027,8 @@ void igt_skip(const char *f, ...) exit_subtest("SKIP"); } else if (test_with_subtests) { skip_subtests_henceforth = SKIP; - if (in_fixture) - __igt_fixture_end(); + assert(in_fixture); + __igt_fixture_end(); } else { exit(77); } diff --git a/lib/drmtest.h b/lib/drmtest.h index 8dd9f7906fd6..c03983295393 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -172,11 +172,11 @@ const char *igt_subtest_name(void); * * For normal tests without subtest it will directly exit. */ -__attribute__((format(printf, 1, 2))) void igt_skip(const char *f, ...); +__attribute__((format(printf, 1, 2))) void igt_skip(const char *f, ...) __attribute__((noreturn)); __attribute__((format(printf, 5, 6))) void __igt_skip_check(const char *file, const int line, const char *func, const char *check, - const char *format, ...); + const char *format, ...) __attribute__((noreturn)); /** * igt_success - complete a (subtest) as successfull *