Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp359282pxa; Thu, 27 Aug 2020 04:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3iiA3L/DTjkAWi74G1fR2Q/uXe+jyP3dj64A2WNtiDiTif050GgXZ0rYAb4lD6LKWYTON X-Received: by 2002:a17:906:b086:: with SMTP id x6mr6373758ejy.204.1598527929963; Thu, 27 Aug 2020 04:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598527929; cv=none; d=google.com; s=arc-20160816; b=rrx3dooA2h6K1c2TXob80waYQqZpzYPrkn9ueLhs1C48NVaB/uz2JpkBcJRqwQ+V6f 6FBUk1JRHwOYQHYaLtTHDazdBuIdki1ODcY2kj2HcY3sf6MCnHS7i7WFQPOKKAv186Bm lHQJI2v0Hakcbg6aSQi/ZCtZwQplrE7QcnfU3qSaC1ynw2jqQ/1EAXMEMJ5gsw+oTJBh JHehHofWt6kch9Ezyo3iRDmctAcsearttFRehQ3XGd6FJOSUTGFFb1TMqurwvebUBRi0 LPGi+biAbuIEAMjRGKLWcEk7oGb02TUvKnOeCIKKov+xxpQz9ctfIgfeyGQGrsVjoy8B ad0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kL50AETAxFQ/Z0PEcxjtY/mje72xQ1KRsR0dYMPRn0c=; b=Oo120BLiaGJbSjy1aBzbaRFQo+0GwLM6QsbNSGfwxl8Tke4zb7jDTEf7kcYs60tp/b MbRg5uTce/zGSSWqdKvroS+tusIpgzhAdtMy8Sr0RK7Slnf3ykRRxzNqgSIjtL9jq2lS vNWN9cHfHQTI9HkTMBSxLo6ea+TodHhSajDexrZCmV81RNmgCA11cMP0aKor1fE8IBdh pO0P4ZpIDQMx0R6LYLsw+DyfSNCEz7c9mU1cbPHjBGGMWzE1zWq1OpjTgxSLc0WCa6pU LHTVJKjYPIkD+olPqD3+zXdiPNc2OYar6ulRUKBEpqbPQKNK7cub+huZrkVTTpC2P4cX xhfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@massaru-org.20150623.gappssmtp.com header.s=20150623 header.b="K6Cc/U/v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si1327331edq.60.2020.08.27.04.31.46; Thu, 27 Aug 2020 04:32:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@massaru-org.20150623.gappssmtp.com header.s=20150623 header.b="K6Cc/U/v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728496AbgH0L2v (ORCPT + 99 others); Thu, 27 Aug 2020 07:28:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbgH0LQi (ORCPT ); Thu, 27 Aug 2020 07:16:38 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80798C061264 for ; Thu, 27 Aug 2020 03:54:30 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id e14so2710266ybf.4 for ; Thu, 27 Aug 2020 03:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=massaru-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kL50AETAxFQ/Z0PEcxjtY/mje72xQ1KRsR0dYMPRn0c=; b=K6Cc/U/vzKW4aV2SdSpKnLr1XjzAN1/VEe0yjjqGP3KsKhratD7w7onOLADM18p/Qs AcGr9a1+s5Q7xa5Opw8DuDF/ohYNjtntk4ddMwwhWH0EWIckOG8814MLnXDsf6VVw3oJ uQ08O9VvQWDytcc2Msrf4hcSDGA1xGcEohd9UfQ8oHMeCFl7SMwRpi/Gbv5/TXcjCyL7 Q3Sd/ItaMD3/1kENtjVpfSpfaBIwFE80iGsGwJkZRidMiEeqGY4KFrN3VJNdS3hwvHcT rwqmRSMs2cp0fcQBUyAprlc0Ry+xBeTo/mS1kmWmDqkB/nZpb9HFDXyWjd3lBUAriq7+ QD+A== 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=kL50AETAxFQ/Z0PEcxjtY/mje72xQ1KRsR0dYMPRn0c=; b=NC7QSjGaOw/j2nYGG8rloAFvrJ7CnkYXbpo1cWLpZJzmlxkv8F/oGTUl1a7uCGsX3D H0wSh2HJxI8WYrJhznL9u5Qnegu625dDYpkJ80tEcR6M8wiD1N6hYHcvlAFmunXljPs+ PUOW8pKdV/ca7W1YK8svnjKiLJ+anCYu7dIJ9qksSjNkEsnZqeV9K0vGuP9dODKkKZYH +N7lkmwB82cz+QUTijwudCpm0NJd7X43zQSAUeRgIKVSjCvPjsPn9rDghNFioqrNEDa6 /VGV5Q6/6xOJ8TRolGj2iGtBb8f3+0UExTW1krI1MQlGPIHlzphVTxTKCgu8q9Sfj22G Wt+w== X-Gm-Message-State: AOAM53185YdoUd/ySA0m41/Gn4TkuNdb8HfyerUVWnExUpdBjYKKHIHE FJ0QRiOwRppQVNZklr+8zBvX4nrrl5jpWkVLC7QU2w== X-Received: by 2002:a25:f42:: with SMTP id 63mr28803335ybp.348.1598525669597; Thu, 27 Aug 2020 03:54:29 -0700 (PDT) MIME-Version: 1.0 References: <20200729192357.477350-1-vitor@massaru.org> <20200827102333.GA3564678@elver.google.com> In-Reply-To: <20200827102333.GA3564678@elver.google.com> From: Vitor Massaru Iha Date: Thu, 27 Aug 2020 07:53:53 -0300 Message-ID: Subject: Re: [PATCH] lib: kunit: add list_sort test conversion to KUnit To: Marco Elver Cc: KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , Brendan Higgins , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org, Greg Kroah-Hartman , tglx@linutronix.de, Andy Shevchenko , geert@linux-m68k.org, paul.gortmaker@windriver.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, arnd@arndb.de, elfring@users.sourceforge.net, mhocko@suse.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 7:23 AM Marco Elver wrote: > > On Wed, Jul 29, 2020 at 04:23PM -0300, Vitor Massaru Iha wrote: > > This adds the conversion of the runtime tests of test_list_sort, > > from `lib/test_list_sort.c` to KUnit tests. > > > > Please apply this commit first (linux-kselftest/kunit-fixes): > > 3f37d14b8a3152441f36b6bc74000996679f0998 kunit: kunit_config: Fix parsing of CONFIG options with space > > > > Code Style Documentation: [0] > > > > Signed-off-by: Vitor Massaru Iha > > Link: [0] https://lore.kernel.org/linux-kselftest/20200620054944.167330-1-davidgow@google.com/T/#u > > --- > > lib/Kconfig.debug | 29 +++++--- > > lib/Makefile | 2 +- > > lib/{test_list_sort.c => list_sort_kunit.c} | 73 +++++++++++---------- > > 3 files changed, 58 insertions(+), 46 deletions(-) > > rename lib/{test_list_sort.c => list_sort_kunit.c} (62%) > > > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > > index 9ad9210d70a1..de4fd020a4af 100644 > > --- a/lib/Kconfig.debug > > +++ b/lib/Kconfig.debug > > @@ -1854,16 +1854,6 @@ config LKDTM > > Documentation on how to use the module can be found in > > Documentation/fault-injection/provoke-crashes.rst > > > > -config TEST_LIST_SORT > > - tristate "Linked list sorting test" > > - depends on DEBUG_KERNEL || m > > - help > > - Enable this to turn on 'list_sort()' function test. This test is > > - executed only once during system boot (so affects only boot time), > > - or at module load time. > > - > > - If unsure, say N. > > - > > config TEST_MIN_HEAP > > tristate "Min heap test" > > depends on DEBUG_KERNEL || m > > @@ -2173,6 +2163,25 @@ config LIST_KUNIT_TEST > > > > If unsure, say N. > > > > +config LIST_SORT_KUNIT > > + tristate "KUnit Linked list sorting test" > > + depends on KUNIT > > + depends on DEBUG_KERNEL || m > > I think the style [0] you linked suggests '*_KUNIT_TEST' for config > variables. > > Only noticed this because I was doing a > > git grep 'config.*TEST' > > to find tests in the kernel + new tests floating on the LKML. Thanks, I'll fix it. > > Apologies for picking this patch to comment on, but if it's still > changeable it might be worth adjusting. No problem. > > + help > > + Enable this to turn on 'list_sort()' function test. This test is > > + executed only once during system boot (so affects only boot time), > > + or at module load time. > > + > > + KUnit tests run during boot and output the results to the debug log > > + in TAP format (http://testanything.org/). Only useful for kernel devs > > + running the KUnit test harness, and not intended for inclusion into a > > + production build. > > Not a big deal, but I'm not sure if summarizing KUnit here is useful. > You already link to the documentation below. Sure, I'll remove this. > > + For more information on KUnit and unit tests in general please refer > > + to the KUnit documentation in Documentation/dev-tools/kunit/. > ... > > Thanks, > -- Marco Thanks for the review.