From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Wood Subject: [PATCH i-g-t 1/8] lib: warn when attempting to run an unknown subtest Date: Wed, 23 Jul 2014 11:57:48 +0100 Message-ID: <1406113075-30860-2-git-send-email-thomas.wood@intel.com> References: <1406113075-30860-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-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) In-Reply-To: <1406113075-30860-1-git-send-email-thomas.wood@intel.com> 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 Cc: daniel.vetter@ffwll.ch List-Id: intel-gfx@lists.freedesktop.org Signed-off-by: Thomas Wood --- 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); -- 1.9.3