From patchwork Wed Feb 18 17:06:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5845431 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BD9DCBF440 for ; Wed, 18 Feb 2015 17:06:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C75BA20154 for ; Wed, 18 Feb 2015 17:06:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A98B1201C0 for ; Wed, 18 Feb 2015 17:06:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2CFD6E03F; Wed, 18 Feb 2015 09:06:21 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTP id C9BDB6E03F for ; Wed, 18 Feb 2015 09:06:20 -0800 (PST) Received: by mail-wi0-f170.google.com with SMTP id hi2so40327911wib.1 for ; Wed, 18 Feb 2015 09:06:19 -0800 (PST) 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:in-reply-to :references; bh=6cY0v62gQSouYFtTSk7QiyJwoaIYyW8PTUWx5sDBQnY=; b=bMRHY8QAnNYldWbCfwFEsANp+PcHVn2gbctKRUu3gGLuq0RNyABBBhkA+9gtTZ4VnW 9Qjtq7d0/hmvq2q5jpqBdHKCqeYxHC/y/NHGkcgYzPvRks7H/d0dB8QrNUfiLYuPc6cu wr8BpJ7mYKBJnCdqvBjn/LJDhpXl509RD02cUjSpNsfX14ah+MQ0DN65VpZ/UB2DikWm c8szzTEjV7//WANsxm9rGiXqI+lYVDxm3kZ//+uYKc1pyIYej67xFapsEOOXB1yLEJt7 EsmxWGrjIuub89X5Wged0vYr0Ypr5Kf+6QFj+Wy/d32jGcFgqC85htXh4gjX+COckBLQ akbA== X-Gm-Message-State: ALoCoQk8HKjWNo25cwuahOWhP576eyFCM8tYxI1oPURdrf5sdo/g4jC+e2qCQxdJwb+2sfRCN8rG X-Received: by 10.194.158.234 with SMTP id wx10mr348176wjb.23.1424279179853; Wed, 18 Feb 2015 09:06:19 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ub1sm33474610wjc.43.2015.02.18.09.06.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 09:06:19 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Feb 2015 17:06:14 +0000 Message-Id: <1424279176-5000-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424279176-5000-1-git-send-email-thomas.wood@intel.com> References: <1424279176-5000-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/4] lib: use defines for igt_simple_init and igt_subtest_init 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 --- lib/igt_core.c | 34 ---------------------------------- lib/igt_core.h | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index eef338b..afecdf1 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -696,40 +696,6 @@ int igt_subtest_init_parse_opts(int argc, char **argv, enum igt_log_level igt_log_level = IGT_LOG_INFO; /** - * igt_subtest_init: - * @argc: argc from the test's main() - * @argv: argv from the test's main() - * - * This initializes the for tests with subtests without the need for additional - * cmdline options. It is just a simplified version of - * igt_subtest_init_parse_opts(). - * - * If there's not a reason to the contrary it's less error prone to just use an - * #igt_main block instead of stitching the tests's main() function together - * manually. - */ -void igt_subtest_init(int argc, char **argv) -{ - igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL); -} - -/** - * igt_simple_init: - * @argc: argc from the test's main() - * @argv: argv from the test's main() - * - * This initializes a simple test without any support for subtests. - * - * If there's not a reason to the contrary it's less error prone to just use an - * #igt_simple_main block instead of stitching the tests's main() function together - * manually. - */ -void igt_simple_init(int argc, char **argv) -{ - common_init(argc, argv, NULL, NULL, NULL, NULL); -} - -/** * igt_simple_init_parse_opts: * @argc: argc from the test's main() * @argv: argv from the test's main() diff --git a/lib/igt_core.h b/lib/igt_core.h index 0086945..88b47bf 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -106,7 +106,6 @@ void __igt_fixture_end(void) __attribute__((noreturn)); /* subtest infrastructure */ jmp_buf igt_subtest_jmpbuf; -void igt_subtest_init(int argc, char **argv); typedef int (*igt_opt_handler_t)(int opt, int opt_index); #ifndef __GTK_DOC_IGNORE__ /* gtkdoc wants to document this forward decl */ struct option; @@ -117,6 +116,22 @@ int igt_subtest_init_parse_opts(int argc, char **argv, const char *help_str, igt_opt_handler_t extra_opt_handler); + +/** + * igt_subtest_init: + * @argc: argc from the test's main() + * @argv: argv from the test's main() + * + * This initializes the for tests with subtests without the need for additional + * cmdline options. It is just a simplified version of + * igt_subtest_init_parse_opts(). + * + * If there's not a reason to the contrary it's less error prone to just use an + * #igt_main block instead of stitching the test's main() function together + * manually. + */ +#define igt_subtest_init(argc, argv) igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL); + bool __igt_run_subtest(const char *subtest_name); #define __igt_tokencat2(x, y) x ## y @@ -180,13 +195,13 @@ bool igt_only_list_subtests(void); #define igt_main \ static void igt_tokencat(__real_main, __LINE__)(void); \ int main(int argc, char **argv) { \ - igt_subtest_init(argc, argv); \ + igt_subtest_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL); \ igt_tokencat(__real_main, __LINE__)(); \ igt_exit(); \ } \ static void igt_tokencat(__real_main, __LINE__)(void) \ -void igt_simple_init(int argc, char **argv); + void igt_simple_init_parse_opts(int argc, char **argv, const char *extra_short_opts, struct option *extra_long_opts, @@ -194,6 +209,19 @@ void igt_simple_init_parse_opts(int argc, char **argv, igt_opt_handler_t extra_opt_handler); /** + * igt_simple_init: + * @argc: argc from the test's main() + * @argv: argv from the test's main() + * + * This initializes a simple test without any support for subtests. + * + * If there's not a reason to the contrary it's less error prone to just use an + * #igt_simple_main block instead of stitching the test's main() function together + * manually. + */ +#define igt_simple_init(argc, argv) igt_simple_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL); + +/** * igt_simple_main: * * This is a magic control flow block used instead of a main() function for @@ -203,7 +231,7 @@ void igt_simple_init_parse_opts(int argc, char **argv, #define igt_simple_main \ static void igt_tokencat(__real_main, __LINE__)(void); \ int main(int argc, char **argv) { \ - igt_simple_init(argc, argv); \ + igt_simple_init_parse_opts(argc, argv, NULL, NULL, NULL, NULL); \ igt_tokencat(__real_main, __LINE__)(); \ igt_exit(); \ } \