Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp774630pxy; Thu, 22 Apr 2021 13:07:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM/h5eFr1kttreIDG9wo5KuhdU0pNb0jcQ6cMiQOrNAQFX+kUrZwcILaKlHDa3Ri9Tv31E X-Received: by 2002:a17:90a:d681:: with SMTP id x1mr509401pju.82.1619122076241; Thu, 22 Apr 2021 13:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619122076; cv=none; d=google.com; s=arc-20160816; b=Xs0zhwr7aj9eb6p/BUZ6zHSPUls6a3YWKcqgpbZlaY2juknCgLfHibFKMz2jrCQZdm Ety8B8xX7PRLTXpYJ8tvleyNNUntRfFDH79xvq6zD4Ab+CtZI30JCO+8ZlIZo1erGQyy lhHTGWsIfegDj9d7kiRjAr9gEX/9a+5kNB30wpCYWXX4ZbMp9ZzrnaaWBRUAmMBoTja+ TS7qoP2DycWtpckr9fryMaZzaTMrK637G142+vU8iFFD8Ufh543RkbQlvcJ+iznbLOLZ OasvrQp0XsIDHM+tIne2trnyelUmwBZX3HKqrJgrX5BE5UUxdmybFpBL0G9UgkJ7gJ+y aE3w== 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=+/wwW78VpebQLZFuGwc6FJXnLCeLVtTQN01haPD78WA=; b=b5X9wv5H4I4z+q9Xl7sVwgjRLwio21YwxKo7zo5bVo/5eIVZju+aAiCu3lgHwMBNjX TDsILXnaiWGJInYUHuEY64AWkG7E9VXBdWCbXn4xdWQLSMgNJtBPGdCwZ3WCMEUYjTMm QwKm39/KXgzzDiFlA6/i3P91kfIJ5pU53VZ/4Dhb6e3rVH9TVhaphcL/MzhxPcOovcET qOS6EDwPfifJjFWfre2e8eMacxvt3JElwBJEFp53+VKz1bmw3pzxnemSlAEa+HTD7A14 zzDP0BIkzJt1uoC4e6FvOtwkyqIhBhNprPen0FIqaI4bM5fmEpKHVc3+6sW3GUAFRfLy 9/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AT041JTA; 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; 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 y18si4089345pfo.71.2021.04.22.13.07.43; Thu, 22 Apr 2021 13:07:56 -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=@google.com header.s=20161025 header.b=AT041JTA; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236058AbhDVUGs (ORCPT + 99 others); Thu, 22 Apr 2021 16:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239111AbhDVUGr (ORCPT ); Thu, 22 Apr 2021 16:06:47 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE6BC06174A for ; Thu, 22 Apr 2021 13:06:10 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id u15so15541628plf.10 for ; Thu, 22 Apr 2021 13:06:10 -0700 (PDT) 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=+/wwW78VpebQLZFuGwc6FJXnLCeLVtTQN01haPD78WA=; b=AT041JTA4EKF/eOPh/bYSQmEq1e8ixvzp5E+CaUpUwWwSuzv7kO7YkV0sGWze83npE HYgDgDQprhfVO+BPYkbpw2BTMloZerEiWcTgHwg3vYSLYUECDYqwaAkbnkAKgzJwvOhF xXHv4A4tZQoVx00IsIJCj3DEZQjBgOiOq1ldbL9ZV7xy64A0nMKJ+WY4Q0jfzEhn82Z7 dHBgh7UMplxXYHdeB++4XfYJdgjxoblqHQ/39JZnV1VaMdt1g+IHwlUN78VKC405w334 hKk8ICKyDAGh8wzM4sWFbEcyqv1wOgmFFKPbj76Kxi99aRUdLBCnUe+MQbV/yUdt+n6i Ttsw== 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=+/wwW78VpebQLZFuGwc6FJXnLCeLVtTQN01haPD78WA=; b=akZz3kw+Z4xFiVC/pZNgNAlShb3IQXgbBZUP69cDnjTwsmQmRqTr6Q6d49mhM3bucf z3yyqjhXPem2pFzrDoTzrVAO+7DiC3zZ4IAU8/fxuji+SCqaiXyPBCz2nyIA/7exmOd/ 2a2TOgGUBIhBJ3Bc5MkVvF6KS/35qdMzUarxlKZ7AyxA4GQValKtRWar4nT4TLQbGLxA 0khopQtyfJp8OVpS8Q6SltmNoyiU/ux8PZ3jsNNd2vxYsjEfYLzSEdIWVMzMJKXb6Fjj T1cPkBaWGFLTsMmKWkO7yW/iJ3z4J8DaTx3V7bnB0RkLuZjM3n1Sh20njrXtM12NnX+F dWmw== X-Gm-Message-State: AOAM53036z4kGfr+0Yt0D8IS7B4I5VbZPFs8ePlfAjPrlakDVeYZbG34 f1M1e+G3ROqaGbJ7Umbl/CTLddNDVtovjRvP81b+IQ== X-Received: by 2002:a17:902:7892:b029:ea:b8a9:6190 with SMTP id q18-20020a1709027892b02900eab8a96190mr219313pll.80.1619121969851; Thu, 22 Apr 2021 13:06:09 -0700 (PDT) MIME-Version: 1.0 References: <20210421183222.2557747-1-dlatypov@google.com> In-Reply-To: <20210421183222.2557747-1-dlatypov@google.com> From: Brendan Higgins Date: Thu, 22 Apr 2021 13:05:58 -0700 Message-ID: Subject: Re: [PATCH 2/2] lib/test: convert lib/test_list_sort.c to use KUnit To: Daniel Latypov Cc: Andy Shevchenko , David Gow , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 11:32 AM Daniel Latypov wrote: > > Functionally, this just means that the test output will be slightly > changed and it'll now depend on CONFIG_KUNIT=y/m. > > It'll still run at boot time and can still be built as a loadable > module. > > There was a pre-existing patch to convert this test that I found later, > here [1]. Compared to [1], this patch doesn't rename files and uses > KUnit features more heavily (i.e. does more than converting pr_err() > calls to KUNIT_FAIL()). > > What this conversion gives us: > * a shorter test thanks to KUnit's macros > * a way to run this a bit more easily via kunit.py (and > CONFIG_KUNIT_ALL_TESTS=y) [2] > * a structured way of reporting pass/fail > * uses kunit-managed allocations to avoid the risk of memory leaks > * more descriptive error messages: > * i.e. it prints out which fields are invalid, what the expected > values are, etc. > > What this conversion does not do: > * change the name of the file (and thus the name of the module) > * change the name of the config option > > Leaving these as-is for now to minimize the impact to people wanting to > run this test. IMO, that concern trumps following KUnit's style guide > for both names, at least for now. > > [1] https://lore.kernel.org/linux-kselftest/20201015014616.309000-1-vitor@massaru.org/ > [2] Can be run via > $ ./tools/testing/kunit/kunit.py run --kunitconfig /dev/stdin < CONFIG_KUNIT=y > CONFIG_TEST_LIST_SORT=y > EOF > > [16:55:56] Configuring KUnit Kernel ... > [16:55:56] Building KUnit Kernel ... > [16:56:29] Starting KUnit Kernel ... > [16:56:32] ============================================================ > [16:56:32] ======== [PASSED] list_sort ======== > [16:56:32] [PASSED] list_sort_test > [16:56:32] ============================================================ > [16:56:32] Testing complete. 1 tests run. 0 failed. 0 crashed. > [16:56:32] Elapsed time: 35.668s total, 0.001s configuring, 32.725s building, 0.000s running > > Note: the build time is as after a `make mrproper`. > > Signed-off-by: Daniel Latypov Acked-by: Brendan Higgins