Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3994698pxu; Mon, 30 Nov 2020 15:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHTZZFP+8qg2FCMJnOH5GK6a5JRdLgQ2rgRbbAZzGQK50YiF1K9krcLz4PR+ztRk62XWDX X-Received: by 2002:a50:fd88:: with SMTP id o8mr45847edt.386.1606777874289; Mon, 30 Nov 2020 15:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606777874; cv=none; d=google.com; s=arc-20160816; b=i5mjgTj3FW0WzjjYVSKpUjf5bA4pKiP2zEdoCyt02OonW910t84Pf0CP0J1vZpcVsa jlbaWayv88ut1kxvQosta+av9kRPKfQ2EXTVpV6gb/UheRD5G55rc1N0sVbzXVLWqyxA 1lCYk1wgK2L3x/Dqc3ZRHGsEuNinlK9OYqBQ82PCWN4berD6vleWwnZd2XVJyx5WHdwv 0uZwtyAlNRgoSel5qJZHjy0esIUzhaf6t4cine6KvuMJQ3Mq4xPYzpGZalJPIAmV3EeK g+rZGyFmz/BQVviK5O90PEPD/SE3EFscGxM2afeNt+YDHz7g0cjh5vZU19tNd0S9Naaa XWCg== 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=yKeppEv6PxhpaKISV122YrtS5AvgtBbtMsR/8wmYbyU=; b=q9sdOtWoX2UTrKu57QjhjaFw2f6utbFFbBrzlMVxqgRWWhCIaczIubdONP0OrxRnCL zrvyvItCrfn4kwlBjBNTOHMtkQH4PzLWP9k0ow2pRd3s72lWdngW1SRcTVnY/pxK7Lri c9uiu8LxITIgY3faO/D/T5jh738q5iOCQ6eMxpZPFtc88b5/780Na5FSAeDM31/3rLNE oI9vGHGfeXkMaAnt2WzFpcMOCWdaw1tRCEaIQ3eigsd2NYx2Don+7GSJ1oQHX/xB6hj7 uhGqCRJdZyOuK9YspKuMeDpnFQzQX04Y5Zeki4HIwkWnonYgcB8SOzivz8u2t8iGOqTf s1fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y3lGqGYO; 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 gl3si8881101ejb.741.2020.11.30.15.10.52; Mon, 30 Nov 2020 15:11:14 -0800 (PST) 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=Y3lGqGYO; 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 S1730535AbgK3WOt (ORCPT + 99 others); Mon, 30 Nov 2020 17:14:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgK3WOs (ORCPT ); Mon, 30 Nov 2020 17:14:48 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB83C0613D2 for ; Mon, 30 Nov 2020 14:14:02 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id g18so785547pgk.1 for ; Mon, 30 Nov 2020 14:14:02 -0800 (PST) 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=yKeppEv6PxhpaKISV122YrtS5AvgtBbtMsR/8wmYbyU=; b=Y3lGqGYO/7M9p+z2hXtjP7WuIHaHG8DZl4ziWsAfd8PA6E5+xhzEu7ZMVFwcGYj6pN fr9blZ8XcH6UKrSguCKiyOejzgp+lXi6oVmXrGAbcuG5PWrUCyzTPQzuIB49fN9pkNLN rKd1IzRP/KiyVYXVvp4OBqhA0DF9XQkr80DXkA8f0YFYaYJ+X05YZpbMANcJqFG9zRjN +AyX77nKcVK7TvY0AsDwdjIs8xlswcm9ZBX4MozPqcvNEy1PdYLf39ImR3hsfOCiFNfL /s9LXejjHWbOdD3T/aVGnoGCehMHMGcsMbKeig6EzQFIzYO7TpXFZOXenQGiZP1pkiGL LJ8Q== 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=yKeppEv6PxhpaKISV122YrtS5AvgtBbtMsR/8wmYbyU=; b=ta7fVw+vNXPJDLoFrKAnVa87TsHceudSxzZ0wUobBTKbwo3Cs1YD/VaDYpdMvr10yM 6KC8rDh2FVPiimLQhmLBaH/w7/6ienMYveooHETxQaXVpf59uXQ3Th7M8wyfL5GvxLWY IsfQy7dQJKvCNnfkrl1HBWpr2lRheVCsM5weiw+DGYvPU9nYX7fukCdbe1vLJolXz5mq tHDQEOpC/DNgsCkh5U8q1dRnsMQEFVKaHMs0nsuinc/oX6YIJCEUDM6egj7Ij0Hj/YHD qyTJ2MPiXzZBGwozY6/IRIGbGbyqS5yjUUD94lulOvOKB1XZ5k0AoxJamfEx9M6T3AJ7 900A== X-Gm-Message-State: AOAM532Vk1TL/RmaVixYuREy8s/t/CTPXOYfYrSARcr5YhZUPDMkiIF5 mQRxnhKpqmprrQiAnK4yEO4zDnGJpU8oRk7RiILWNQ== X-Received: by 2002:a62:ed11:0:b029:19a:e1cd:ca96 with SMTP id u17-20020a62ed110000b029019ae1cdca96mr7046798pfh.38.1606774442044; Mon, 30 Nov 2020 14:14:02 -0800 (PST) MIME-Version: 1.0 References: <20201123225759.3658122-1-dlatypov@google.com> In-Reply-To: <20201123225759.3658122-1-dlatypov@google.com> From: Brendan Higgins Date: Mon, 30 Nov 2020 14:13:51 -0800 Message-ID: Subject: Re: [PATCH v2] Documentation: kunit: provide guidance for testing many inputs To: Daniel Latypov Cc: David Gow , Andy Shevchenko , Linux Kernel Mailing List , "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 Mon, Nov 23, 2020 at 2:59 PM Daniel Latypov wrote: > > usage.rst goes into a detailed section about faking out classes, but > currently lacks wording about how one might idiomatically test a range > of inputs. > > Add a new chapter for "Common Patterns" and group "Isolating behvaior" > and this new section under there. > > Give an example of how one might test a hash function via macros/helper > funcs and a table-driven test and very briefly discuss pros and cons. > > Also highlight the KUNIT_EXPECT_*_MSG() variants (that aren't mentioned > elsewhere [1]) which are particularly useful in these situations. > > It is also criminally underused at the moment, only appearing in 2 > tests (both written by people involved in KUnit). > > [1] not even on > https://www.kernel.org/doc/html/latest/dev-tools/kunit/api/test.html > > Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins