Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1492493pxb; Fri, 6 Nov 2020 11:01:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhxmRtLDnvTDo0R0CZXZKE3uiBSIMF+vntTKWw2+XH1b3qG1ZZn2wBJ9FgiuRalwnnS7r/ X-Received: by 2002:a5d:4a07:: with SMTP id m7mr3252337wrq.316.1604689282244; Fri, 06 Nov 2020 11:01:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604689282; cv=none; d=google.com; s=arc-20160816; b=zdV+91l7h+vFt9of/8LUWnlMpqsPa3GKTGt7aphgOgDdjrXoPodeNEMuip1yLEtjWC V7DkNXN9y2xVIIUJfV5999gNt8jHjX34BmLqVPp62HDD0FH/nxV5yTWCsV2k2c4DW3N4 yvV8i7B+NYMfgskFmJDIze7HyRdeCkNjQpaJIucfCsZdVpEkUhwBUjiwSuYujdlMWhdF Fof11B34a+qeUzBMIhYS9kaQSj34nmKCnW88u7GAKoYMe+NUYbg70JlJ5WTztVk0uYfE 4uGRfKCVojsmN+w+fxl2yQcgSbciTqAX8g8B+IsUsh9V0j3fXdmnhwqSZ65JMbOP0jMh iBvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=osiQ0zXJkLm7Z32q6Iqh9lbvOM7+fovpv2pnsk5vfMg=; b=DpBNnEb8DjMjdjO5mKecKvfXLQKVRmQUatwZzuzheKuAGe92F4AbPDWi2x+FQjKNlG 3zPEn5VuKZA7pnupi9La58QmuYH+F9my+QXt8IOYPO0htH3wr1+je1r5zPP+bBaJ1FvS oU7ij6P3CulVxqIOQdm4INUQv/fQ0lCQ16OiVjiPCb6c1p0iIFMnUsFWRasD5YOpJFhe oXTLXyp3ml7I/YT2Gdm6O+eBp4Us9vyYHZECpCAaKbd4BMrkIv4GegRpKcW3AVa9038h JoN91j/v6hy40Xr2a9w22c5w0aCy/5KbJrI8XOgNeKg2ejGoAqwON4iutgEUQWvfhh7f +tog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="iI/eDGrT"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si1607817edm.38.2020.11.06.11.00.47; Fri, 06 Nov 2020 11:01:22 -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=@gmail.com header.s=20161025 header.b="iI/eDGrT"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727178AbgKFTAo (ORCPT + 99 others); Fri, 6 Nov 2020 14:00:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbgKFTAo (ORCPT ); Fri, 6 Nov 2020 14:00:44 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D1EC0613CF; Fri, 6 Nov 2020 11:00:44 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id b12so1083480plr.4; Fri, 06 Nov 2020 11:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=osiQ0zXJkLm7Z32q6Iqh9lbvOM7+fovpv2pnsk5vfMg=; b=iI/eDGrT2XC8TgtHtAWlztgLJgDeKb76vx0VWayTT1g5AKYGr5uxuDJBa1tJWfA4mv aHSrAhLV6tIBhAytZkdVsrUL1Gru7aRdqyfmekLNoeK6Jb3Cyv+dB/VG7Q6IJXOHxbxl pyF7BkhN0H56eIAS7kb1cpPqV1HMP3C56JwgQlAWcV07VmibKhy5oVbGxREILfjYmTcb ZlQoWHEo8SA/PytiL9A/w2n1VQMXsBig8akLIKmg/Y2Ni47aPbdImuXl0EOW9cVDxI4e hNeiCOzeWexSut7IGLESbAJwXBXCFTkJQLyP3Jnj0gypfe04AaNS7u+eLHahdyn11s4w 3G+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=osiQ0zXJkLm7Z32q6Iqh9lbvOM7+fovpv2pnsk5vfMg=; b=ccU7lmhj+Wt93euce6L+7hV/IFxaFbhlGwu8d88bKbfJo+KRIT6lcNrKeJ1BqQqWnO NdvOfQ7PEg83D+T7QGtp1NfQ8EdIpmOufHzzDF9n5Pe6Jn0luY7kCrls3VdwTFYDwDVO 25aEw2BmHXtTpqNYpcfBItgHIEnpZN8puS2mpgvoekUq7TY4hYNJxpi8K2odezvAduTA WtB//42Qxi7/Vft58SVMUGWlwQ/BXWfWI8uT1QXCdg5c8Csc0mPNA/J/VFwgAwn0Guf1 lk/U0zA4LPVuWNblnVVW1uB3rTJxsR9UPzbiihtf6o2OuNse0aS/W3LYgAQxCIqG+MXP C9qg== X-Gm-Message-State: AOAM5318e1PGBIb8yL4y0xKcTo2IdZANCOVU58cBYL0ywcg2TpZMZ6ze Gvzj63+NOSjg7YAE70AQ0Cd1uTyvRynWF0Px X-Received: by 2002:a17:902:ed0d:b029:d6:ebe0:7cc2 with SMTP id b13-20020a170902ed0db02900d6ebe07cc2mr2936997pld.53.1604689243708; Fri, 06 Nov 2020 11:00:43 -0800 (PST) Received: from [192.168.86.81] ([106.51.243.217]) by smtp.gmail.com with ESMTPSA id 30sm2648759pgl.45.2020.11.06.11.00.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Nov 2020 11:00:43 -0800 (PST) Subject: Re: [PATCH v5 1/2] kunit: Support for Parameterized Testing To: Marco Elver 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 References: <20201106182657.30492-1-98.arpi@gmail.com> From: Arpitha Raghunandan <98.arpi@gmail.com> Message-ID: <11549107-7247-03a7-2469-f5aa793a0d19@gmail.com> Date: Sat, 7 Nov 2020 00:30:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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! > Thanks, > -- Marco >