Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3439600pxb; Sun, 26 Sep 2021 15:36:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGZHZXdpt1k2VLATKdKwM/htLx4CDbKR61aoaJubjxDiReTgMhJMmarTSCFbXThjyAA8Ba X-Received: by 2002:a05:6a00:1742:b0:438:b04b:4b57 with SMTP id j2-20020a056a00174200b00438b04b4b57mr20565699pfc.47.1632695763159; Sun, 26 Sep 2021 15:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632695763; cv=none; d=google.com; s=arc-20160816; b=T9l7va7O2DgmpPy2j/zvRmcgRS9rgE9+qPBfFcY3wPvUWH3P0bMgxpoXoNeX8kvsW5 PeXuh3koScJYfyGLSfQv7eWc+vslhlOMb22hYFqgtEoU+7mGyOCcdHWOqPtQqim/0nRx PVDboqc6pQWzCIYgT4mpn7wsWY7ZGzBJadKNdjHywzERIOfbYjoEaB0wMcoTpLNMml+Y JUoVEOArZL626wesNiXuxGjK6llgPI9hcB7BBmerP2CyB0HlLEZ5WFZUY1w3uvErkZE+ bukzah297MieDizhGbwvSLD8EJefbqNN+6pHa+iZkg7xuemVW+eL+U+f/BPg8N6Ws9/N sjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ihFPTFKKKq4JF63fFgU4S70k8fEeFkVZwaLA0o+0S1w=; b=nj+v+N7LTUVWIaBIWmT0RQH9jwSpN6BjtubWW0Y3zgj3L4AfBbuot8AFwfQBMU00pp 1vB8DQ4cHBabMNnGgsLEA4UxLLxcQNgPUx6b211JhhgdUqgGMCcLFQKH476C6Q+sHeYe sBSJ3IfQsk3ygVDmXmSgeUUOQSV8ZSJQOUkJFEgtJwu4/oJJIxaE6Q4xDwN7IEi8ik5K YHKFfJURZ2YdfUVO7CXvBvm7GLL8xDw2Ua8DQ6FogSTd5UFALDzVjfYimqmSJuIHYvl0 sfeb1TZlzEJdDc+wZ+AraCHV1iQf+LUIikUiicfKWEnnnk2NpeogKg2XrIWhH96n5sRm odtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=dt6kBKPf; 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=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot13si17034579pjb.134.2021.09.26.15.35.25; Sun, 26 Sep 2021 15:36:03 -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=@usp.br header.s=usp-google header.b=dt6kBKPf; 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=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbhIZWfH (ORCPT + 99 others); Sun, 26 Sep 2021 18:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230392AbhIZWfG (ORCPT ); Sun, 26 Sep 2021 18:35:06 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66A3EC061570 for ; Sun, 26 Sep 2021 15:33:29 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id d8so15043136qtd.5 for ; Sun, 26 Sep 2021 15:33:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp.br; s=usp-google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ihFPTFKKKq4JF63fFgU4S70k8fEeFkVZwaLA0o+0S1w=; b=dt6kBKPfhesz6dYT4wmTDIEwXlzaggBWLdWaQcYWSpLTvcbCrGkjSfZjOqBbK+rH5b arzqWzA7d9m89grrzH7dspeb5/5cfnQi+HzHvZNH0ejZmDYZ+FqlrKVJlrhONuFQ9mqD sTUpopnfFaYU7kVlQ4qVk0apIdL0cFL5m2msYcQXRaB/49F4hU9L0jJkko32yCEuDWDN GAk6Y5pgq9bQQheIQCFrPqIGkyFURYc+Kxr2qp7DydpaokM7l0yqPAPDMkXAclKz/MMa 77QkLn2bSDCGG6XC51arCYAUw5uPGCWijIKT7SXsQIfAsZTyXerBMqEXMQJFGSlEBL+C 9kJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ihFPTFKKKq4JF63fFgU4S70k8fEeFkVZwaLA0o+0S1w=; b=jHEaKBEx1puu9I1PZG7yd7OmPTy78qOSjyiwilSPRPysJaMSTjh+5GEErfVu/JKJIb YF0sbLJUQ00+SsXkj0egKS0Ae4IvTRaYucva5i9m5Mz3rg0nUosARVn9nZVmn56VAEfd h/Y1GRbSWSpYwe9gshA+ifgx5NHJ8fslDkyeg+cgEkx7+xbHFHbHwSEkPOCkCwfZAsg1 NALyYc2kEHDAChUN/+MhpO7tyUA1sMMjq0ERuDxGxW3PpSmR9LcEZMvWLg8d+E8HgxB1 vy2wvKyF0N9dds80oMxmnwzD34/9aIf7WZvX/ep82FM6kyPidFTqq0zi9KDHR1n1Yfkr L4fg== X-Gm-Message-State: AOAM5322G/UoxXYZPOz6VhXdBj6tt20rGNMy1NQ6DouOvcdr4QEICGUi LyoGFkTbS+WflS3LQef8X3LWjA== X-Received: by 2002:ac8:d3:: with SMTP id d19mr13696347qtg.409.1632695608592; Sun, 26 Sep 2021 15:33:28 -0700 (PDT) Received: from aehse.localdomain ([2804:d41:bd1c:9100:f2e1:f671:7a83:1eb8]) by smtp.gmail.com with ESMTPSA id x6sm7244151qts.79.2021.09.26.15.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:33:28 -0700 (PDT) From: Isabella Basso To: geert@linux-m68k.org Cc: ferreiraenzoa@gmail.com, augusto.duraes33@gmail.com, brendanhiggins@google.com, dlatypov@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, Isabella Basso Subject: [PATCH v2 0/5] test_hash.c: refactor into KUnit Date: Sun, 26 Sep 2021 19:33:17 -0300 Message-Id: <20210926223322.848641-1-isabellabdoamaral@usp.br> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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/5 we noticed that there was an unused define directive that could be removed. - In patch 4/5 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/5, 3/5 and 5/5 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. :) Changes since V1: - Fixed compilation on parisc and m68k. - Fixed whitespace mistakes. - Renamed a few functions. - Refactored globals into struct for test function params, thus removing a patch. - Reworded some commit messages. [1] - https://lkcamp.dev/ [2] - https://lore.kernel.org/linux-kselftest/CAGS_qxojszgM19u=3HLwFgKX5bm5KhywvsSunuBAt5RtR+GyxQ@mail.gmail.com/ Isabella Basso (5): hash.h: remove unused define directive 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 | 247 +++++++++++++++++-------------------- tools/include/linux/hash.h | 5 +- 5 files changed, 139 insertions(+), 149 deletions(-) -- 2.33.0