Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp18283pxb; Wed, 25 Aug 2021 18:39:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCW8E9R7N4KCk/yDd3CHDWbL0cWKu+uZuj4OtSrQrmSN5q4Xauo2+wYBxI1cRp7SWS4ite X-Received: by 2002:a05:6402:4cd:: with SMTP id n13mr1529440edw.215.1629941964292; Wed, 25 Aug 2021 18:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629941964; cv=none; d=google.com; s=arc-20160816; b=r29borvnR+Dq4DFHVeh+sf3Kh5DqIC5Z39dhFkVfE1Poq/FwNc4eWs/bzucDODiiww fSrRg26imOfBiG+JcMb8FYtmr4lWK4rRAVH3pD8J8yyMmjiA0vPz90Bnik8PRQuB4dE5 QXXdw9RBl6ife0WSWq4uGJNq7C9wZelLrFxcsQe0fvEiN6LS2TSBFczhuh/ap2PktdWC DftZXVS646RPrFfAY1830WPFRm2QycWj+Hs3LmQeNdjlsXw71q+SXzoMxdur4G7Nh5Ll 2OaEiI1AAROdD+WDQI1s9eAe5RrEvd0N6Mu0YR46+5pshnKyuXwpsrdOw9bprxGTFxNA BRgA== 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=bN4zsDLKjtt39ALjBnlM/U1e98GFstFGSAjcJ+DqyDw=; b=ZQ3l5CR7nR2mJ4+gqy95Cgu9190LWpu69YGoH7gQU1pMchczudEXwchppBqOCM0Mtf hyW32/K6p2zS7PcJX/7pHNR6lGgaDH4h0xpqWM0QTCp7cG7ay4A+DhaA2W5iWTvIxkHM QllJtnG5AAESbUzfAIygmcXyuFeZ1SOCpsfg5AVfrRWNb58HjfRwOzsNeCUIGQ8F989x kfeL1F+1TFPishSWCMllgl3CKT2+D/t0y+mYlz6iYd1MrVJqWjve3SYykU1Gr8q/ON/w YQar9b4sy5dXeWbTQxBl0vpLJZW5alctu5yg5uqbE2LcKrrupDvX1Kipc68lK757Zor7 B6yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jHGlMt2E; 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 m4si1634621edc.427.2021.08.25.18.38.59; Wed, 25 Aug 2021 18:39:24 -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=jHGlMt2E; 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 S235201AbhHZBhY (ORCPT + 99 others); Wed, 25 Aug 2021 21:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235847AbhHZBhX (ORCPT ); Wed, 25 Aug 2021 21:37:23 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0744BC0613C1 for ; Wed, 25 Aug 2021 18:36:37 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id j18so1631323ioj.8 for ; Wed, 25 Aug 2021 18:36:37 -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=bN4zsDLKjtt39ALjBnlM/U1e98GFstFGSAjcJ+DqyDw=; b=jHGlMt2EU21XsDt8PXNtXXjDxr+y+uRiVBmep5USzEgnidbtBhGBtCCoHQ2Dp/4GMC rxpn8+Rb6shA1JFazRqV5kDLNQumDQLtJQa7mseQxwbgDRdtI6USuWvqM+c5R6pRaJHm ob+K/oJlDz+A8nfYT/8X2IfbO625U+waXKC/8jWigvl2r5BHlHz1oBw+CI8kS6lKEiEI wzLbq1n40fjbu+m9V7Wm1U/V158Bi6WKwvelY6SXuB9r7AKFnc1IfDxsEvF4I6Qu0trc c+IM4fGCkZzNH9Bcy5iXe27YgJCtna0wFHXhnKzKcHoDqyFxkA56WH875Y1aqSyo4TBp r1OA== 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=bN4zsDLKjtt39ALjBnlM/U1e98GFstFGSAjcJ+DqyDw=; b=qHZxXB0iUAAxhjasjqaqTYchNEKqBqyoKWLfL25It1Z+JLv246kxg+syjPFqfl/wfk cD/pfhsJqGCre/CbAimDga3PP2CAmJphrCJUwu956Wv3qK5Rw1xf92xjWNRtTWqsqtQj H4+WQpK0sJJkzKbXLOwZhyROMiW16KVgKXnOHRzPh+Yworp7hxejyh0PEXTfzSpHPL9e +Yc+wOpps5SnNs6QnkMP01tt6/UL1ROd+FX+TxY9gab5pUFdvmqeTcqPmqoAGK1v4egk rRfFy9WYbFD/UC1qnCMPMxLj8qalGSkoaf9p0HZwPoNL6mr2Ecv1qyZ5dUeUAoQnqZhE n5rA== X-Gm-Message-State: AOAM532tl7qnoDvL/VcPSbnVNi1wWxpB1lwmbOvQRkLvovLB1gpYtcZD npXFdgFRSWle7N0CTe1/IgnRk5uvUqZoprKm37f7wA== X-Received: by 2002:a5d:8484:: with SMTP id t4mr1032429iom.126.1629941796235; Wed, 25 Aug 2021 18:36:36 -0700 (PDT) MIME-Version: 1.0 References: <20210826012626.1163705-1-isabellabdoamaral@usp.br> In-Reply-To: <20210826012626.1163705-1-isabellabdoamaral@usp.br> From: Daniel Latypov Date: Wed, 25 Aug 2021 18:36:24 -0700 Message-ID: Subject: Re: [PATCH 0/6] test_hash.c: refactor into KUnit To: Isabella Basso Cc: linux@sciencehorizons.net, geert@linux-m68k.org, ferreiraenzoa@gmail.com, augusto.duraes33@gmail.com, brendanhiggins@google.com, davidgow@google.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, ~lkcamp/patches@lists.sr.ht, rodrigosiqueiramelo@gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25, 2021 at 6:26 PM Isabella Basso wrote: > > We refactored the lib/test_hash.c file into KUnit as part of the student > group LKCAMP [1] introductory hackathon for kernel development. > > This test was pointed to our group by Daniel Latypov [2], so its full Oh, I hope I didn't lead you down a rabbit hole. I just looked and saw that it used pr_info()'s to show that it was skipping some stuff. And I thought the new SKIP test support in 5.14 was something y'all might not have been aware of, so I pointed to it as a motivating example to rebase to get the latest KUnit patches. I didn't do my homework and look into the test to see how suitable or not it was for KUnit. But I'll try and find some time soon to go over and review at the KUnit parts of this patch series. > conversion into a pure KUnit test was our goal in this patch series, but > we ran into many problems relating to it not being split as unit tests, > which complicated matters a bit, as the reasoning behind the original > tests is quite cryptic for those unfamiliar with hash implementations. > > Some interesting developments we'd like to highlight are: > > - In patch 1/6 we noticed that there was an unused define directive that > could be removed. > - In patch 5/6 we noticed how stringhash and hash tests are all under > the lib/test_hash.c file, which might cause some confusion, and we > also broke those kernel config entries up. > > Overall KUnit developments have been made in the other patches in this > series: > > In patches 2/6 through 4/6 and 6/6 we refactored the lib/test_hash.c > file so as to make it more compatible with the KUnit style, whilst > preserving the original idea of the maintainer who designed it (i.e. > George Spelvin), which might be undesirable for unit tests, but we > assume it is enough for a first patch. > > This is our first patch series so we hope our contributions are > interesting and also hope to get some useful criticism from the > community :) > > [1] - https://lkcamp.dev/ > [2] - https://lore.kernel.org/linux-kselftest/CAGS_qxojszgM19u=3HLwFgKX5bm5KhywvsSunuBAt5RtR+GyxQ@mail.gmail.com/ > > Isabella Basso (6): > hash.h: remove unused define directive > test_hash.c: move common definitions to top of file > test_hash.c: split test_int_hash into arch-specific functions > test_hash.c: split test_hash_init > lib/Kconfig.debug: properly split hash test kernel entries > test_hash.c: refactor into kunit > > include/linux/hash.h | 5 +- > lib/Kconfig.debug | 28 ++++- > lib/Makefile | 3 +- > lib/test_hash.c | 249 ++++++++++++++++--------------------- > tools/include/linux/hash.h | 5 +- > 5 files changed, 136 insertions(+), 154 deletions(-) > > -- > 2.33.0 >