Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp459540ybd; Wed, 26 Jun 2019 00:55:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7Z1jpZHSXTnZWGftbDSlQWJ5COHODY0xkg9MuxBkcOx475nsba5yvQTwEj8+MxL1aggW3 X-Received: by 2002:a17:90a:b883:: with SMTP id o3mr3120668pjr.50.1561535723103; Wed, 26 Jun 2019 00:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561535723; cv=none; d=google.com; s=arc-20160816; b=sheDqMeYHHrxLrnhfzQkb495nlkk4mztWO/F/uNtLCS2Ch8SPby+Bsy9w9TMCnieJ+ A40f3dtyoDTJ5z99XZGC7JOGSfBdbhqhktGFjwvDPlmEqyAVv4s62IaZnllnk/wWCyAT Ixln1uiqKgGXCKmU2xsbkaq9baZx8tOGdD/PHH7CdXjwXgoidbLuRRUbhOjrlD2ZhdRn OgVM8VUhYy2LX3y8HSBt+ECh6Er0v6lbeWdlcan/WhUdsYWGw3Tj9c+Kss4MKjidhFO6 WbMMHm6+MBdNjQUz36NW34YEne/Funu4i9DZZTUXluN80QghMBJfjDYBHINExUeyy4rj UUZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JHqsYYLzLAosbxbz1ZkSkQroLN+I/zt1AzacawmONrY=; b=wP2W930w43P+2ubHyjgAOA6wyEzRdHxIIuVs4lkwc+X3lVSINM38QbISEsg+e0597/ mzRbVr8xnTC2XWYcJVfLGjlC6k9zzIaCJegJkqYB3Y63B1Iv0nG08W+FiT4OPuprGydw XvO4+ybXAWwOiQ2CTJ/mPqeAVJimc/vNHYgy9oB75MA+bkcucLlYZryGWFbaLv1T1c+S SejaMCKaeWZuN9rV8qO6kbYPg4N+YIDkmPBk4XLBko2wJEXUYHVBVNT5hZnYpiWakYLJ +XH35+pyQ5jieTuDrXD62lW2rVNfaV3QVUD3G8EuW7b1xNNwK834jBgrnPoTHaKFKuik P6Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WyqM1jV2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si2647704plg.71.2019.06.26.00.55.06; Wed, 26 Jun 2019 00:55:23 -0700 (PDT) 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=@google.com header.s=20161025 header.b=WyqM1jV2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727092AbfFZHxa (ORCPT + 99 others); Wed, 26 Jun 2019 03:53:30 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33462 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbfFZHxa (ORCPT ); Wed, 26 Jun 2019 03:53:30 -0400 Received: by mail-pl1-f194.google.com with SMTP id c14so993612plo.0 for ; Wed, 26 Jun 2019 00:53:30 -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=JHqsYYLzLAosbxbz1ZkSkQroLN+I/zt1AzacawmONrY=; b=WyqM1jV2u/kxM67gNNChMCD/srWLt8UFxif+PHuGpzbgE3LpTJrt7rEbevH6EDg7EA xF8tH7Jbh3PLlZYXRvyhQyTIN9G45hD9SE3+nPI4rxVnH9lZ6Wb6PT2UPR9Z7e8qw5Vo j4hYPGbTDYxJLGb6+arVCfAloAtiPanpPW4Xadwr7qterJdRgNGgoWGT+JtgLvBc9l+M DYSnM5SC1DrNcCapOU3OT8L/UFesJC+ezl51GMqT04qGxB9qB/8ifxdT+misqvwEisfJ +/kivnaJfyaOnnN1uM1pke3PaHrKRWJDezKNt97NibKS5p1mAANOOVhiidQQgXRP+WeK EcUQ== 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=JHqsYYLzLAosbxbz1ZkSkQroLN+I/zt1AzacawmONrY=; b=HL1uaiz2SYPPa26dogKXajbkDvUxo7J9fu5IwD8UpXSdGRcZBxvuBfRe5fPAZTovvw 2JmPpmkA+juhffTpsPDqHzPBQLyicAG9zu9qhqvW8UR37vHbd6aug7BkBpkel0H2alBJ g77ZBYquh1og7dAJbtrEHKC19Oi/O5MAt43+qoixCI92wtiFHSkILhi7MLeSV5tmTySw 6Szcc8ZnCP1mICUEvHTlIuNBNFoI0Tc8He37UlyHOKj6J2SNn3oOjGoG6WZ+Q5L8EGpv SahqNl5BEhf7Er6RIrLwx2KdXm4xlgXgHkSERR6amfpQ/Ia+M6oUqCfczhd4QAnNaOM5 Rbbw== X-Gm-Message-State: APjAAAXyPIiTcWgQzshvNge6UhC9v+IrBTrQCDwDMAB8xBjPp8r0hz7W T+XQU+6YbQb2a8eC2Sx4wPbkqVUjN1ONNhub6IQYqg== X-Received: by 2002:a17:902:1004:: with SMTP id b4mr3862082pla.325.1561535609164; Wed, 26 Jun 2019 00:53:29 -0700 (PDT) MIME-Version: 1.0 References: <20190617082613.109131-1-brendanhiggins@google.com> <20190617082613.109131-8-brendanhiggins@google.com> <20190625232249.GS19023@42.do-not-panic.com> In-Reply-To: <20190625232249.GS19023@42.do-not-panic.com> From: Brendan Higgins Date: Wed, 26 Jun 2019 00:53:18 -0700 Message-ID: Subject: Re: [PATCH v5 07/18] kunit: test: add initial tests To: Luis Chamberlain Cc: Frank Rowand , Greg KH , Josh Poimboeuf , Kees Cook , Kieran Bingham , Peter Zijlstra , Rob Herring , Stephen Boyd , shuah , "Theodore Ts'o" , Masahiro Yamada , devicetree , dri-devel , kunit-dev@googlegroups.com, "open list:DOCUMENTATION" , linux-fsdevel@vger.kernel.org, linux-kbuild , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , linux-nvdimm , linux-um@lists.infradead.org, Sasha Levin , "Bird, Timothy" , Amir Goldstein , Dan Carpenter , Daniel Vetter , Jeff Dike , Joel Stanley , Julia Lawall , Kevin Hilman , Knut Omang , Logan Gunthorpe , Michael Ellerman , Petr Mladek , Randy Dunlap , Richard Weinberger , David Rientjes , Steven Rostedt , wfg@linux.intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 4:22 PM Luis Chamberlain wrote: > > On Mon, Jun 17, 2019 at 01:26:02AM -0700, Brendan Higgins wrote: > > diff --git a/kunit/example-test.c b/kunit/example-test.c > > new file mode 100644 > > index 0000000000000..f44b8ece488bb > > --- /dev/null > > +++ b/kunit/example-test.c > > <-- snip --> > > > +/* > > + * This defines a suite or grouping of tests. > > + * > > + * Test cases are defined as belonging to the suite by adding them to > > + * `kunit_cases`. > > + * > > + * Often it is desirable to run some function which will set up things which > > + * will be used by every test; this is accomplished with an `init` function > > + * which runs before each test case is invoked. Similarly, an `exit` function > > + * may be specified which runs after every test case and can be used to for > > + * cleanup. For clarity, running tests in a test module would behave as follows: > > + * > > To be clear this is not the kernel module init, but rather the kunit > module init. I think using kmodule would make this clearer to a reader. Seems reasonable. Will fix in next revision. > > + * module.init(test); > > + * module.test_case[0](test); > > + * module.exit(test); > > + * module.init(test); > > + * module.test_case[1](test); > > + * module.exit(test); > > + * ...; > > + */ > > Luis