Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1496389pxb; Fri, 6 Nov 2020 11:06:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNxKB6S9/fz16EnvGme6cTWiJtvWX8uUVSRihIHEmbhIMXsItagt3ylK1H6XHTtzSK+pJD X-Received: by 2002:a17:906:5fd0:: with SMTP id k16mr3607376ejv.133.1604689616471; Fri, 06 Nov 2020 11:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604689616; cv=none; d=google.com; s=arc-20160816; b=zeSzclbFK+/Mn60Tfz9g2HBAsEjqQuF2S7pJAl0oebrb/tUuZWNjp284SjEij8UI4V jALINWRvI/Urvy264Qe07DJ82HzNyKCoP2CPC3xAWsrxvy0GSRaIesNsmqz7gwnyF2Cc HxS40GHWR0qECrfSL65paIXhcnGbbWLpEyL8nXWsP8XQBTrjMJQAeVfIXGOcsBIIrOTy ODJDAzbEoEDk8+JylXfwxzBXwHKBTd2oWjW876+IYkhtGw/qffRYzhKLY8buvYdoD62M K1EOvdbJWO3KLItguGoKv1wX4xCHV5+iZF1ktZDkJeExhL2inAmCZKUSgBvvWJ+zXS0W B/5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=R698vTS3sP7K10LIp+T/pBAzJll3NJN4xvHU3P1DGwg=; b=PFigzRd01X+8LTvWWE9nhxj4fpYnZ+28voOQ6rCG7bc26Fe8LXGBF5pikNgbXekjYp pKhVB4C818r54oV7ikz54cb6SsmkdquTie6+Mmj679wD+1WzMFuezt16apAi9WdcQxmM 6gsaYSLajqM8wSinsBkTYJNTRvG2QDy0rASu9jh0tS3NN9x+YzbYUlnnYet45qWMr/7E 11OgpQEZpCiFpsxZb+PkrvHOd4IqcIo7S1dh/CwPbDlaIFz0hf88pxAE3TX0WhZacXMr 9nfM4qXB6vZKmOXXPYi5ximGg3xjGjT/YpZWRnicD4Xll5vuYYBQz/qOLZlsw4VPih7s 6TBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VaEnLf46; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si1411007ejc.324.2020.11.06.11.06.31; Fri, 06 Nov 2020 11:06:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VaEnLf46; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728274AbgKFTFh (ORCPT + 99 others); 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-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 > > >