From patchwork Wed Jul 23 10:57:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 4609871 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 0B8C99F375 for ; Wed, 23 Jul 2014 10:58:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DA10201BF for ; Wed, 23 Jul 2014 10:58:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D15CA201C7 for ; Wed, 23 Jul 2014 10:58:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B62E6E623; Wed, 23 Jul 2014 03:58:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by gabe.freedesktop.org (Postfix) with ESMTP id D056E6E009 for ; Wed, 23 Jul 2014 03:58:01 -0700 (PDT) Received: by mail-wi0-f172.google.com with SMTP id n3so7546438wiv.5 for ; Wed, 23 Jul 2014 03:58:00 -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:cc:subject:date:message-id:in-reply-to :references; bh=zvHyYL1ijKgN+0G0c5kqpAz4qmI0FpKHc1GuuG510N4=; b=bGpsfF/nCRx6SQ2mq6dhTm3XZQANME5V3xB9KtDUclfaWXuKTJWQ3L7/ulB2XAIsYa 59gvQf6BaD/I2pcTeXCv9vr8wLqN+ZapU5swJfhpwVbVfvF8xcntYbwzQ4P6o3KkUGBJ xArUa2uRAamcX6gTEcjvGMG7Qr5SKCqyOk36IMUrYaEFC3hMNcLdQqt0AyYQ9xojVBpv qpZBrj0mim6y8ZwhO/EGoT+IPWcYpxeEfLVOFTXjny0Xtj6UYfjwduAhLrsxbNqaOIh/ oI1vqZbYD+gDI4jwzQ2mrI3xDNLGoqcjzFSYUEHuvAWIOPA8VVjNGi8GjaYpPrm3Lz3a S1ZA== X-Gm-Message-State: ALoCoQkeGd2yK6VTuFlG+0Fa3Hi7MyIMARFxc+jpsUQiw4oEkfqK0bHW6bXS+tgLvYP28UWBK940 X-Received: by 10.180.36.18 with SMTP id m18mr2026064wij.74.1406113079604; Wed, 23 Jul 2014 03:57:59 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id de5sm7787760wib.18.2014.07.23.03.57.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jul 2014 03:57:58 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Wed, 23 Jul 2014 11:57:48 +0100 Message-Id: <1406113075-30860-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406113075-30860-1-git-send-email-thomas.wood@intel.com> References: <1406113075-30860-1-git-send-email-thomas.wood@intel.com> Cc: daniel.vetter@ffwll.ch Subject: [Intel-gfx] [PATCH i-g-t 1/8] lib: warn when attempting to run an unknown subtest 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.2 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 Signed-off-by: Thomas Wood Reviewed-by: Tim Gore --- lib/igt_core.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index b197932..5c20581 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -204,6 +204,7 @@ static unsigned int exit_handler_count; /* subtests helpers */ static bool list_subtests = false; static char *run_single_subtest = NULL; +static bool run_single_subtest_found = false; static const char *in_subtest = NULL; static bool in_fixture = false; static bool test_with_subtests = false; @@ -484,9 +485,14 @@ bool __igt_run_subtest(const char *subtest_name) return false; } - if (run_single_subtest && - strcmp(subtest_name, run_single_subtest) != 0) - return false; + if (run_single_subtest) { + if (strcmp(subtest_name, run_single_subtest) != 0) + return false; + else + run_single_subtest_found = true; + } + + if (skip_subtests_henceforth) { printf("Subtest %s: %s\n", subtest_name, @@ -722,6 +728,12 @@ void igt_exit(void) { igt_exit_called = true; + if (run_single_subtest && !run_single_subtest_found) { + igt_warn("Unknown subtest: %s\n", run_single_subtest); + exit(-1); + } + + if (igt_only_list_subtests()) exit(IGT_EXIT_SUCCESS);