Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1484550pxb; Fri, 6 Nov 2020 10:46:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNFhnKemQ314yoHyTMcvSgCsLWu/KFBUTiEmO8d+80sFxNDngtmea6mJt9ZzhzxmTiHlnb X-Received: by 2002:a17:906:7844:: with SMTP id p4mr3397939ejm.26.1604688411324; Fri, 06 Nov 2020 10:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604688411; cv=none; d=google.com; s=arc-20160816; b=acedfC+o2fLEgj/i8Gv+FaA3ukv3NIxrsWGpd/cynWTUo7hcJDLGmdn+6d/EqHMmK6 2xKaK5NnXnwbCdiWhOV5H0/pw0vNFl8V8OvFhl/M5jJ+Vt2EiYxSofV9LowBL/u3YreQ iozy2uOIf6XMqJMJvUhdTjaUUPotnFfS9XYC3dp8jeshxQq80IwYzWqrnaXXIQangsn/ lGwDSECkTfZonyaP9vasG1Mtk9v2Q17uXtBFeJB6vBVVA9LOWz6iA8uQGn88NsWjabM4 WNCXb6blsjIdvBSzcTYb8hLTh3fZ0ZUbXRi7FH2Pzx28hy2RiHILfLytjyBEFai4ShxD NIfQ== 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=ElN3AyTjh5aMXmGHUFTcrTsMazikTf7o2LtiuSniYZ4=; b=QckhFm/8V1QXZAP++WNPMBDWSKZB+2hr4cZyEUK/TgODvgOiyKZfjq7OLgnBp9j2de xkB2lLQoni07emn28VOu9XrgXdAo66wJ2U9ZryEM2pu2EbFXg+Ianker4Xw/0CyBHCCE 9lzuEFLJ4xPhF+byeVTXxjGbsAAKY2Jq8h6QtrpBgRl7e9iGCLiga4lOxLCQzFTRiiP5 8SXZhjrnjAg1k+3gIYOXNQvh7YwUoehdiQIW/JX0tDfz9a8CaTOLiNYexSuBDab1c9qn H/yeGfFCAOkZY4CMxU6foTS6Yj2sGKSYoteMtQsYx42yMtCrlOnjs5f2r30la9DSugPs Ni5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D5+Q8S8g; 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 z19si1632342edx.461.2020.11.06.10.46.26; Fri, 06 Nov 2020 10:46:51 -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=D5+Q8S8g; 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 S1727805AbgKFSqK (ORCPT + 99 others); Fri, 6 Nov 2020 13:46:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726447AbgKFSqK (ORCPT ); Fri, 6 Nov 2020 13:46:10 -0500 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688B3C0613CF for ; Fri, 6 Nov 2020 10:46:10 -0800 (PST) Received: by mail-ot1-x341.google.com with SMTP id j14so2165956ots.1 for ; Fri, 06 Nov 2020 10:46:10 -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=ElN3AyTjh5aMXmGHUFTcrTsMazikTf7o2LtiuSniYZ4=; b=D5+Q8S8gQ/D72X/54r2aCENNdmG3qQ/uSOs4qlrC+meTGrBxWzyUhbGN5AcVRTbEoX aBSlJSl6MMdPmek/r8GTKw7FWl8xaY2+bPHhNZzTHG/0p2owpuWq/aKHsdju2u8Fnvzi vUDnyU57uiirO5PL4roeYjBl10DFZqt4pZ5UO/cJGeBRMCpUP0Hh/3nCf1LJ50MLGTOb 1mRyWLZT4mNkiGXwj1Y4seayHJZR0/rogLS8o4xfuxPZsiC75TDzUe7IbEPkul49oP6t YZmd+0T8fWEzyfDN/uM1DegNmzRu9xJlEABocHUEQaG6ygy2Lvg9lKy3Vb+HQqWkvMXg lY0w== 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=ElN3AyTjh5aMXmGHUFTcrTsMazikTf7o2LtiuSniYZ4=; b=VJsQH3MsUZl8G06th0vkb5vnjaoP7TTA7aTicTXxWlY7UMFPnqFJnQf48Vvk19f4QT fbJopTY82mDcreSCrgirJftIXLeErKN3zaLOlmJnrVVykKjSwt8C6vEUis3YtiQKYYmq dTI1LjOSsyJLXcbMh8BfUzgo6BINPfHb3rSKx+++BROXVsO8Q0AJQrfSsAawY7uiXe6T cLeROqOMk47SwlvVaRgSZclO6a/bTK/LUxZJJCvTErEpzBt4/DTnBP7RINYqnb/pahd0 nwLSgJPQ8E+u+zU7qAdCwf5G76EhW/JTTb+T9qTS3dn04ba7CN42yXssrUK6IIPiii1v gZHw== X-Gm-Message-State: AOAM531iATiV3ccg/P1vRUl8aqltqkVgNrWWjLRlIaZfSxcO+N8fzGMU HU2sYOMKg6KSPDcEt8DqbO1Iv8+HlOPb3ldiI6R5GA== X-Received: by 2002:a9d:65d5:: with SMTP id z21mr1868950oth.251.1604688369657; Fri, 06 Nov 2020 10:46:09 -0800 (PST) MIME-Version: 1.0 References: <20201106182657.30492-1-98.arpi@gmail.com> In-Reply-To: <20201106182657.30492-1-98.arpi@gmail.com> From: Marco Elver Date: Fri, 6 Nov 2020 19:45:58 +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 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. Thanks, -- Marco