Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1113685ybt; Sun, 14 Jun 2020 10:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwckh0e0o+4qsBfxfjdfbNh5ArtY58Ec6dVfMDecyKcJT8A5kazlDbKa1F/vbT4xIn0IA5F X-Received: by 2002:a17:906:35cf:: with SMTP id p15mr22739599ejb.520.1592157024958; Sun, 14 Jun 2020 10:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592157024; cv=none; d=google.com; s=arc-20160816; b=Y8DLZXqyPUk7NkTx1kAwRrLTsWgbPxQQUHS+KREsSC8LnvO5Mm7Iyz1Lp2ydxjzEL/ nA4NCeEuE0/nZYggl2XgV04p5q/9SwGFjAq/WRgNFgeEewgf8c4fdT204vpOXgcL97xI X2kzAYf4imOFI11VMQltzDQ/YD01CDxgpK5RnItJGlg1t/oMgPjl0Hlxv+pTa8q0OUHi ou/B55eACSt084ah9cv70rHgonDbUf8R+Q6lD2meor7VCiB/oMeIFzlEGfsTcxX6xli7 XK4qQeUi1+cfhsfSasUPSJITGpd0KvOSMxtK5z6fZ99qlcnTTrFAoVBwrpYL8mtbna5L es7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=iVzpsWsc+ucplBrjqeKrqJAgIWgN+U4AVWHu2CnNfCw=; b=DjacZq9RHvC4w26nzujXfIJM5dj/g7RNLLFP/Yu3lzcvNtAbOKkYBtyQiCLinPXAkw 9b9MaWmj5s454u42Gksa2kpcQEWbgYRqghwxwkhQcMzY7jBcPHjcP17ARiYB8WqHFKml 07qN2MunDf2gcxV+7OFkvizE9We6CNbGxztgW2buHWElnx4J8px2sjUdoIHfLYL6Akll ldYpMe4KWOH7eme9ulQ7sQwoyr516qr0VwNjOHanB93CZ4AlhnyDw4PfpTH6lhXZ+cin 2hYby9gz6pDRtU77rSIjNKTAothlDKOJsvYGUQQufslTX4onTrnuaRnRxUETmUfFaX6l Awvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aIwjQl1s; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si7918516ejz.569.2020.06.14.10.50.01; Sun, 14 Jun 2020 10:50: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=@chromium.org header.s=google header.b=aIwjQl1s; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbgFNRsN (ORCPT + 99 others); Sun, 14 Jun 2020 13:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgFNRsN (ORCPT ); Sun, 14 Jun 2020 13:48:13 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A332EC03E969 for ; Sun, 14 Jun 2020 10:48:12 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id l63so4336215pge.12 for ; Sun, 14 Jun 2020 10:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=iVzpsWsc+ucplBrjqeKrqJAgIWgN+U4AVWHu2CnNfCw=; b=aIwjQl1sUiDQ2w0UO6H5e+TIMjXcNjQhvZvthliLOZyfJEdErfxsx9txCoJekTR1hW NzbqMEA2ougHWqc3j9sPog4RX9IBSGvyEBS0Fg4w5wuU6pPuGNmKl5YaEItykcdgw0dl TwnrEKrubrUOYnfVYJoOsGWqnoHEpQ+GfCWYQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=iVzpsWsc+ucplBrjqeKrqJAgIWgN+U4AVWHu2CnNfCw=; b=PZNp7Fnra/8ZmZ+4721v5xaj78HaF/1AmpHPGAx2jk/7CulNCw7vjRx0Jj4FbKJsId hIBqAVxTVdkE15Z9gPpF+2kuYO8Mn3ShVgrnxN5ofdOlnfEFJznGCnjmSvolhUgn9Vop tIMwdtVCkkEKakYGff4dXdB7LTo8h2kfTuElzH6QUy5QTxJ20Ko3h6WUiO23WOqDGMvI JuQsMPItEAz3KtiAbeEZkD71k2sQdcmouaIR/WP2g+AidnDaVb0vO40o9SXi35hm8fQy HPEBC4X6T73iO8L/5NWjcHQg3UWdq7wpWT/iERH9Re2yAFLD2L1QWtYRoWiHjRZJfxZC eqKg== X-Gm-Message-State: AOAM531TriDgGJRdh/mDsR6GDhhNt0FJbMDMuM5OSVvu/wtBDe3TIFhW zbJoVJjBao7KoFkQwk0CDPn+Zg== X-Received: by 2002:a63:4f1b:: with SMTP id d27mr18066209pgb.389.1592156891996; Sun, 14 Jun 2020 10:48:11 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id ca6sm10154511pjb.46.2020.06.14.10.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 10:48:11 -0700 (PDT) Date: Sun, 14 Jun 2020 10:48:09 -0700 From: Kees Cook To: David Gow Cc: Vitor Massaru Iha , KUnit Development , Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , Brendan Higgins , linux-kernel-mentees@lists.linuxfoundation.org, linux@rasmusvillemoes.dk Subject: common KUnit Kconfig and file naming (was: Re: [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions) Message-ID: <202006141005.BA19A9D3@keescook> References: <20200611215501.213058-1-vitor@massaru.org> <202006121403.CF8D57C@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 13, 2020 at 02:51:17PM +0800, David Gow wrote: > Yeah, _KUNIT_TEST was what we've sort-of implicitly decided on for > config names, but the documentation does need to happen. That works for me. It still feels redundant, but all I really want is a standard name. :) > We haven't put as much thought into standardising the filenames much, though. I actually find this to be much more important because it is more end-user-facing (i.e. in module naming, in build logs, in scripts, on filesystem, etc -- CONFIG is basically only present during kernel build). Trying to do any sorting or greping really needs a way to find all the kunit pieces. > Both of these are slightly complicated by cases like this where tests > are being ported from a non-KUnit test to KUnit. There's a small > argument there for trying to keep the name the same, though personally > I suspect consistency is more important. Understood. I think consistency is preferred too, especially since the driving reason to make this conversions is to gain consistency with the actual tests themselves. > Alas, the plans to document test coding style / conventions kept > getting pre-empted: I'll drag it back up to the top of the to-do list, > and see if we can't prioritise it. I think we'd hoped to be able to > catch these in review, but between a bit of forgetfulness and a few > tests going upstream without our seeing them has made it obvious that > doesn't work. > > Once something's documented (and the suitable bikeshedding has > subsided), we can consider renaming existing tests if that seems > worthwhile. Yes please! :) > My feeling is we'll go for: > - Kconfig name: ~_KUNIT_TEST As mentioned, I'm fine with this, but prefer ~_KUNIT > - filename: ~-test.c I really don't like this. Several reasons reasons: - it does not distinguish it from other tests -- there is no way to identify kunit tests from non-kunit tests from directory listings, build log greps, etc. - the current "common" naming has been with a leading "test", ignoring kunit, tools/, and samples/: 53 test_*.c 27 *_test.c 19 *[a-z0-9]test.c 19 selftest*.c 16 test-*.c 11 *-test.c 11 test[a-z0-9]*.c 8 *-tests.c 5 *-selftest.c 4 *_test_*.c 1 *_selftest_*.c 1 *_selftests.c (these counts might be a bit off -- my eyes started to cross while constructing regexes) - dashes are converted to _ in module names, leading to some confusion between .c file and .ko file. I'd strongly prefer ~_kunit.c, but could live with _kunit_test.c (even though it's redundant). > At least for the initial draft documentation, as those seem to be most > common, but I think a thread on that would probably be the best place > to add it. I'm ready! :) (Subject updated) > This would also be a good opportunity to document the "standard" KUnit > boilerplate help text in the Kconfig options. Ah yeah, good idea. -- Kees Cook