From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2105C55178 for ; Fri, 6 Nov 2020 19:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B4C6208C7 for ; Fri, 6 Nov 2020 19:05:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VaEnLf46" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728280AbgKFTFh (ORCPT ); Fri, 6 Nov 2020 14:05:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728278AbgKFTFg (ORCPT ); Fri, 6 Nov 2020 14:05:36 -0500 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 798FFC0613D2 for ; Fri, 6 Nov 2020 11:05:36 -0800 (PST) Received: by mail-oi1-x241.google.com with SMTP id u127so2405859oib.6 for ; Fri, 06 Nov 2020 11:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R698vTS3sP7K10LIp+T/pBAzJll3NJN4xvHU3P1DGwg=; b=VaEnLf46w5vIExY59a+G9WTSqIbWqj+eUMwZksdIYvwFgg9NYmW6tFJMVSO7nUQ4tD ezz/DeLkXzjkhfXUHKcSGlFbUyh42hxCne6/lYXZejfEeetFS3kISHyyD1FgWP5c4qFa M9IOzy15cbcppijEQghWGg7j94ijBny6yqeVwvc4HsYgoB6kJ0I+W6Pmtxd6WaPrPufA HAmkD9D05NWgQR8UQF6VFzQJkA+/LUIRLx6LPpIkN1mPEKR3unfNWZMF0D5s2hHk0za8 kI0RIMFIKvratitfXOYU32CibW45aA2MR1uWhaBI8UujKK2eJRIVz+yMbHVQs5UDyUsN kEBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R698vTS3sP7K10LIp+T/pBAzJll3NJN4xvHU3P1DGwg=; b=VXh0wOLKElvt2z5fzCYXhQy+Gu+IE83XEmpX57hyI8d7MblN6qsX+rwrNfdtmuCBmY YAz3VDlAl1q60SuwocjXirJlBmCKg6ThncOB75Uyta0Ofr6Q2gPh1hvofeOx1mbXGOdl 1zWCBGty6wJRn6/J7YxOqLXe9a4yfzkbin+6exr4VoEv7klJ3QYQN4MFu0g5skQWtQEq TW2e/IS16YsxqZo3sW/OLwhegeUaK7R5RqyTijyLF6hTIOM1j0Ph8WYrZscH/4UiO4iV 7XCSQ7/FvkWCGDKVJZ7rFnX3xbfLGTzqi9BUAgOo+HnoM1o235j2upZ/ofL4iWGruatk pORA== X-Gm-Message-State: AOAM531twGQS+0M4h1UaSKn8DuZXabSojy6CH4R4bubQTdq7sfsSkx/b icjGo0rgYQUtjbFBrhTyKYw4dczirAcapbtdzKoiYg== X-Google-Smtp-Source: ABdhPJyZWFBrGNICpuwwmJZU0LRFQXm5D2oVyMpcLMzRrOflbicLpntjl2xTCu1rs052y24YptuLj5Ko4AXCh6MZ9Ok= X-Received: by 2002:aca:6206:: with SMTP id w6mr2060911oib.121.1604689535633; Fri, 06 Nov 2020 11:05:35 -0800 (PST) MIME-Version: 1.0 References: <20201106182657.30492-1-98.arpi@gmail.com> <11549107-7247-03a7-2469-f5aa793a0d19@gmail.com> In-Reply-To: <11549107-7247-03a7-2469-f5aa793a0d19@gmail.com> From: Marco Elver Date: Fri, 6 Nov 2020 20:05:23 +0100 Message-ID: Subject: Re: [PATCH v5 1/2] kunit: Support for Parameterized Testing To: Arpitha Raghunandan <98.arpi@gmail.com> Cc: Brendan Higgins , skhan@linuxfoundation.org, Iurii Zaikin , "Theodore Ts'o" , Andreas Dilger , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , LKML , linux-kernel-mentees@lists.linuxfoundation.org, linux-ext4@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, 6 Nov 2020 at 20:00, Arpitha Raghunandan <98.arpi@gmail.com> wrote: > > On 07/11/20 12:15 am, Marco Elver wrote: > > On Fri, 6 Nov 2020 at 19:28, Arpitha Raghunandan <98.arpi@gmail.com> wrote: > >> > >> Implementation of support for parameterized testing in KUnit. > >> This approach requires the creation of a test case using the > >> KUNIT_CASE_PARAM macro that accepts a generator function as input. > >> This generator function should return the next parameter given the > >> previous parameter in parameterized tests. It also provides > >> a macro to generate common-case generators. > >> > >> Signed-off-by: Arpitha Raghunandan <98.arpi@gmail.com> > >> Co-developed-by: Marco Elver > >> Signed-off-by: Marco Elver > > [...] > >> - kunit_suite_for_each_test_case(suite, test_case) > >> - kunit_run_case_catch_errors(suite, test_case); > >> + kunit_suite_for_each_test_case(suite, test_case) { > >> + struct kunit test = { .param_value = NULL, .param_index = 0 }; > >> + bool test_success = true; > >> + > >> + if (test_case->generate_params) > >> + test.param_value = test_case->generate_params(NULL); > >> + > >> + do { > >> + kunit_run_case_catch_errors(suite, test_case, &test); > >> + test_success &= test_case->success; > >> + > >> + if (test_case->generate_params) { > >> + kunit_log(KERN_INFO, &test, > >> + KUNIT_SUBTEST_INDENT > >> + "# %s: param-%d %s", > >> + test_case->name, test.param_index, > >> + kunit_status_to_string(test.success)); > > > > Sorry, I still found something. The patch I sent had this aligned with > > the '(', whereas when I apply this patch it no longer is aligned. Why? > > > > I see the rest of the file also aligns arguments with opening '(', so > > I think your change is inconsistent. > > > > Ah those lines had spaces instead of tab and I think I messed up the alignment > fixing that. I will send another version fixing this. > Thanks! It was tabs then <8 spaces to align. checkpatch.pl certainly is happy with that. > > Thanks, > > -- Marco > > >