Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8093662imu; Tue, 4 Dec 2018 02:53:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WSRPrLsiBKwXT2wkL331ys1qNvfG794u/jX4I9KWk+YB/PMgp+VgYHBfWi69C/OIu4eyNX X-Received: by 2002:a65:4946:: with SMTP id q6mr15894709pgs.201.1543920790148; Tue, 04 Dec 2018 02:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543920790; cv=none; d=google.com; s=arc-20160816; b=nejKkAUGK50w2ioBcmrMSnpfQSuVuw5wUQDXo66i/WUVa7xu4vLYlykG8PLc6YPDZG eqaigbDAkPljYXnbh+rIBu1GscdomZtiDWgXeKr5y4KQim0olfYN9tvk4AhfQkHpPoMo ovzd+oZpOcXWevyquXsBobWGqmXLvW9uvbdipUeb8IQDX/OMxIPgLQsjc7Ff0fjVFS3b S8FCVZJ2Ha44ms6o8PzMdnap9/G74zqVP+aKwHjYqFQXq+DgRnMuywgqzc99oSmbkcWD /o4WLxDZCccoTegIU8tIK8Fheh8LtNRH0HDg02dG33IaYu+bo69bh+k8vc3+We+PCYcV Ka9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=3JGB9Rk8uh7bmDIvBxKSn8FwKCVRpWf8R2IWACPKkq4=; b=pi31gxiDVN7k8sbCn+lG+cSJKw6GJpJNWh7dD0WyQOxussdMPxA5glA2DU0cGpaj11 V2hZg4E1cF4ocd2+7d0ocRUgVsIhT5ZT89JrS96xywJs6eAEylvxzNvOND1DiXntRhc/ 8OaPOQnAZwSmjpbcBsP7QUSxdlKJpYz5CTBwSVvU8HCiJWUa6T/co1S8keTzrpUIDO6U SdWgVmu93ZqwsD6YesvURaV46Cl7WJi9ksQvc27rkKezr3gzrRBvpuGViJKmPp58kpx9 8/ZdDQ2hcMR4NZsxhgkpe/w5NgJpJREcEkTgrCEFMk4+N31UhQTLPhq5b5b43SZyOCtW B/VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nMDWhHmD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si17609800plb.253.2018.12.04.02.52.54; Tue, 04 Dec 2018 02:53:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nMDWhHmD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbeLDKwU (ORCPT + 99 others); Tue, 4 Dec 2018 05:52:20 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46884 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725764AbeLDKwT (ORCPT ); Tue, 4 Dec 2018 05:52:19 -0500 Received: by mail-pl1-f195.google.com with SMTP id t13so8095545ply.13; Tue, 04 Dec 2018 02:52:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3JGB9Rk8uh7bmDIvBxKSn8FwKCVRpWf8R2IWACPKkq4=; b=nMDWhHmDDVM4w+qva0l7MUwlmSLPu9dS9NXYp+EvzHCfNNmAw5D0OZxlulW3bIB7E0 jt60t+fWrnpqLWySb0Zs8fsXq8zlx3jKL4kroL8QyTB2aPSXWSXPQHYEbmtN/172VeJP FzxfzoLFfopaaP5Vyx9LIbnX6K2SOl98RnoRGdvUNF89zRysvbd+gFzMrhgEFzasgQqD 7Hymq1TMFfuLl/UNZaWikdRW224ABvM8d1HVFqlfL+i74rsD3UJ31absJdHd3G5zV513 COvid2GFkNhNKCv+lupiEX+B930uH4ihCG2JGQJ6WRjipqXyYHJ134IbPdDdDIqMtiXK A51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3JGB9Rk8uh7bmDIvBxKSn8FwKCVRpWf8R2IWACPKkq4=; b=lSQzY360H4/fKqK6EANB0IWQOW5Spc1HXHqDWimzPkquB+fL7My0DhbK0Tb9ukk67/ 5cIpkfej2TxL5LRDH/2EJwXZbVifwiPZAsmaMC8V6rnFDoU2dguMnqLSUGTWIBnsna+Y IKMKNwcVxDA1awE3HDuoYJgzTX77AZFkLL1ossDrq8OPRLWwdwjEV55/mOWfWmmKut1H 7dmrZ3NEg53b6H2gvOoKz50fueqfH56nIcwEFrga1c+vptQXzJeUjD6U+PQmwO0uxN7O w+GKHQfA/j38oR73FtEK2iiDMnyWvOlPgVwMZzcEOz3lFzhneLuMN+4mAiazNt3CTBfa Y8Qg== X-Gm-Message-State: AA+aEWZvmZtQQB+fVa+bucz2QcFB16HX6sVNTyX2aIl77PB+r4EPpVYB /Qr73kxNSoh2T0XDw08Zl1o= X-Received: by 2002:a17:902:714c:: with SMTP id u12mr19320476plm.234.1543920739006; Tue, 04 Dec 2018 02:52:19 -0800 (PST) Received: from [10.231.245.170] ([125.29.25.186]) by smtp.gmail.com with ESMTPSA id c23sm23354191pfi.83.2018.12.04.02.52.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 02:52:18 -0800 (PST) Subject: Re: [RFC v3 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework To: Brendan Higgins , gregkh@linuxfoundation.org, keescook@google.com, mcgrof@kernel.org, shuah@kernel.org Cc: joel@jms.id.au, mpe@ellerman.id.au, joe@perches.com, brakmo@fb.com, rostedt@goodmis.org, Tim.Bird@sony.com, khilman@baylibre.com, julia.lawall@lip6.fr, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, jdike@addtoit.com, richard@nod.at, linux-um@lists.infradead.org, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, robh@kernel.org, dan.j.williams@intel.com, linux-nvdimm@lists.01.org, kieran.bingham@ideasonboard.com, knut.omang@oracle.com References: <20181128193636.254378-1-brendanhiggins@google.com> From: Frank Rowand Message-ID: <8807ac55-44e7-0ab7-176d-a0f71bff07e6@gmail.com> Date: Tue, 4 Dec 2018 02:52:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181128193636.254378-1-brendanhiggins@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/18 11:36 AM, Brendan Higgins wrote: > This patch set proposes KUnit, a lightweight unit testing and mocking > framework for the Linux kernel. > > Unlike Autotest and kselftest, KUnit is a true unit testing framework; > it does not require installing the kernel on a test machine or in a VM > and does not require tests to be written in userspace running on a host > kernel. Additionally, KUnit is fast: From invocation to completion KUnit > can run several dozen tests in under a second. Currently, the entire > KUnit test suite for KUnit runs in under a second from the initial > invocation (build time excluded). > > KUnit is heavily inspired by JUnit, Python's unittest.mock, and > Googletest/Googlemock for C++. KUnit provides facilities for defining > unit test cases, grouping related test cases into test suites, providing > common infrastructure for running tests, mocking, spying, and much more. > > ## What's so special about unit testing? > > A unit test is supposed to test a single unit of code in isolation, > hence the name. There should be no dependencies outside the control of > the test; this means no external dependencies, which makes tests orders > of magnitudes faster. Likewise, since there are no external dependencies, > there are no hoops to jump through to run the tests. Additionally, this This question might be a misunderstanding of the intent of some of the terminology in the above paragraph, so this is mostly a request for clarification. With my pre-conception of what unit tests are, I read "test a single unit of code" to mean a relatively narrow piece of a subsystem. So if I understand correctly, taking examples from patch 17 "of: unittest: migrate tests to run on KUnit", each function call like KUNIT_ASSERT_NOT_ERR_OR_NULL(), KUNIT_EXPECT_STREQ_MSG(), and KUNIT_EXPECT_EQ_MSG() are each a separate unit test, and thus the paragraph says that each of these function calls should have no dependencies outside the test. Do I understand that correctly? < snip > -Frank