Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1732403rwp; Thu, 13 Jul 2023 16:02:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZQKqxqMvu7PvnBVjw+KD4hFQ4Z5qYY6xwTdqfQGJAmz213tAo74bT0l+ocm6MZAGaDpBP X-Received: by 2002:a05:6512:1110:b0:4fc:6e21:ff51 with SMTP id l16-20020a056512111000b004fc6e21ff51mr2589713lfg.40.1689289339570; Thu, 13 Jul 2023 16:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689289339; cv=none; d=google.com; s=arc-20160816; b=qfUfXS2YaEXh+SwqAN7YBeqQ4XAdNeNHdEBPcqsy2gIPufJ7eTzKLa9xmV2qBmaQgm czX+ACXr9i8eelmRPi9Rwq67tX4da6nsRk5NOJsHj6bgdxBx+FrIY9ERNv4UXRqlg1vs pxs2ujUP+grQaLas6LJSq+uME+mPjwc2Lfmw0eqvUY8K2jkYqmCreye3VhRVQiI9t28k vPzEuF7Xn+oNYNXHw3aJ60gn67R+uWEFtF9r3YQAJwxPLHr339Vmk+3UHUiRy0jNpr/I EU0x06Nspp3XwgjYYNpvyRgTlXksgzl7y2RQ3UZ++K1EC4QGz0mKmP4kPL0Z12qIsCYm dSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MzcnyZs6D3jZP1/90Em2wdIP94ZrD+KbkxYDRuLwWJE=; fh=QU/tsrm10BVh6ZnAyGS1GUhdsxXQ0rhO5+MHEtdattw=; b=LnTebmC7fXfrAACmXbnk3fls5+RMo6/FMIYRPeAUD0BJ31wI4AS9JcNxTy1cYm2O0E P+zp/MiDRc1qBYpc9sig34bP22a/xdmCNRyEpFpmiDYwPjzWu7lEvp7F8FFrYCdYAHP8 cB2Yf3o55LBb7iD5f7huNGo/GLZy7TmFJ1lnEWsveeMMjzRW+R1N8ncJnwYlWUGc4FF4 OdMxyhkZ5Z0dUiuxjJfmwt3Tb0XfkOeYp8KBSs0BHPTg43RHm5zVVfgfEAWMB1/lbS0Q hxokDzjF7C7YiKXiubtMN/LkrwK/CoZOw778UupLKrKwW/s0/aCgq0wBNQu7WR9Eahv2 vuzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=YbSBSKEG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020aa7c38d000000b0051dd3314051si2300456edq.188.2023.07.13.16.01.55; Thu, 13 Jul 2023 16:02:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=YbSBSKEG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233139AbjGMWtU (ORCPT + 99 others); Thu, 13 Jul 2023 18:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbjGMWtT (ORCPT ); Thu, 13 Jul 2023 18:49:19 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C5D02D46 for ; Thu, 13 Jul 2023 15:49:17 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-51ddbf83ff9so5267a12.0 for ; Thu, 13 Jul 2023 15:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689288556; x=1691880556; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MzcnyZs6D3jZP1/90Em2wdIP94ZrD+KbkxYDRuLwWJE=; b=YbSBSKEGuVEqFb+8L1xB90bbx9PAx1IFGTDlwilLvm19IfKutZMrVwaN1yOaCXRzw5 MZUQjJpEWVZM0DR2m5AxleVdTk2ymAh4HpgWCiWdwfTjEVXF/OpyyFu9SpllQ9lrpzdT xyz9Ijr8jA8PvvDfPo4oQpv5DJikjRnpxtuIZp0ll1yB/cHvfRQFiMg+OlFSVqnBDCy6 XZDThvtyAqCF75ID6U6JTpxG0+cS19CczfMsQ91gOY/M4t0H+rGN+4TvSNyxeinNxePx 0VjKQaZWz00m4npcN3skY9OJrbHcetRubpJbVaAiBp269Hce49FsIai61vXQji+qF6jZ yGAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689288556; x=1691880556; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MzcnyZs6D3jZP1/90Em2wdIP94ZrD+KbkxYDRuLwWJE=; b=cskGDF6FwjbOjHNyu0vP4/jlTr9DQ9V0KEjG/EvPKGf2N+3In8GW8aqDcj1+DiWH06 IFyRkhu76R/dwyIvArh67KOYGXykCrDgKa0xk8O00kFwnO+xdgrahXk4cml1NKer9DM+ elE2EdRUE3493uUJrqIGMdtBcIKIB3FpLfiD4kzHalRNC+07v5Wa1NmWl57bxlmBOqgL nwaHI6KW+PLGu+PkLNVYvER5I+d5yWq54MC+IE+QmrqU5A8kU6F9bIzrHIoq8AKS9kXq Qtb/qHcJ4b7xErnBiQi+bIS2alkOcVVEGwB+PSNp9C2wEADb5gruszkZO+fUvau7QNcP A8YA== X-Gm-Message-State: ABy/qLY37WGIxQYs8Pgco8PFjORI4S90XPr9XrwRKMxiE1oMndE98IuS c22gI98a+bgCZVGVHmcqtQVaYlNyOThmFGWf79cg0g== X-Received: by 2002:a50:9ea7:0:b0:514:92e4:ab9f with SMTP id a36-20020a509ea7000000b0051492e4ab9fmr297828edf.7.1689288555839; Thu, 13 Jul 2023 15:49:15 -0700 (PDT) MIME-Version: 1.0 References: <0e5f68ab045965292fee1748254bf9b91db9039a.1689171160.git.mchehab@kernel.org> In-Reply-To: <0e5f68ab045965292fee1748254bf9b91db9039a.1689171160.git.mchehab@kernel.org> From: Rae Moar Date: Thu, 13 Jul 2023 18:49:02 -0400 Message-ID: Subject: Re: [PATCH RFC 2/2] drm: add documentation for drm_buddy_test kUnit test To: Mauro Carvalho Chehab Cc: Brendan Higgins , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Darrick J. Wong" , David Gow , "Jason A. Donenfeld" , Jonathan Corbet , =?UTF-8?B?TWHDrXJhIENhbmFs?= , Nikolai Kondrashov , Shuah Khan , Arthur Grillo , Kees Cook , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, mauro.chehab@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 12, 2023 at 10:29=E2=80=AFAM Mauro Carvalho Chehab wrote: > > As an example for the new documentation tool, add a documentation > for drm_buddy_test. > > I opted to place this on a completely different directory, in order > to make easier to test the feature with: > > $ make SPHINXDIRS=3D"tests" htmldocs > > Signed-off-by: Mauro Carvalho Chehab > --- > > To avoid mailbombing on a large number of people, only mailing lists were= C/C on the cover. > See [PATCH RFC 0/2] at: https://lore.kernel.org/all/cover.1689171160.git.= mchehab@kernel.org/ > > Documentation/index.rst | 2 +- > Documentation/tests/index.rst | 6 ++++++ > Documentation/tests/kunit.rst | 5 +++++ > drivers/gpu/drm/tests/drm_buddy_test.c | 12 ++++++++++++ > 4 files changed, 24 insertions(+), 1 deletion(-) > create mode 100644 Documentation/tests/index.rst > create mode 100644 Documentation/tests/kunit.rst > > diff --git a/Documentation/index.rst b/Documentation/index.rst > index 9dfdc826618c..80a6ce14a61a 100644 > --- a/Documentation/index.rst > +++ b/Documentation/index.rst > @@ -60,7 +60,7 @@ Various other manuals with useful information for all k= ernel developers. > fault-injection/index > livepatch/index > rust/index > - > + test/index > > User-oriented documentation > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > diff --git a/Documentation/tests/index.rst b/Documentation/tests/index.rs= t > new file mode 100644 > index 000000000000..bfc39eb5c0aa > --- /dev/null > +++ b/Documentation/tests/index.rst > @@ -0,0 +1,6 @@ > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Kunit documentation test > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +.. toctree:: > + kunit > diff --git a/Documentation/tests/kunit.rst b/Documentation/tests/kunit.rs= t > new file mode 100644 > index 000000000000..6ffc151988a0 > --- /dev/null > +++ b/Documentation/tests/kunit.rst > @@ -0,0 +1,5 @@ > +Kunit tests > +----------- > + > +.. include-test:: drivers/gpu/drm/tests/drm_buddy_test.c > + > diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tes= ts/drm_buddy_test.c > index 09ee6f6af896..dd6c5afd6cd6 100644 > --- a/drivers/gpu/drm/tests/drm_buddy_test.c > +++ b/drivers/gpu/drm/tests/drm_buddy_test.c > @@ -737,6 +737,18 @@ static int drm_buddy_suite_init(struct kunit_suite *= suite) > return 0; > } > > +/** > + * KTEST_SUITE: set of tests for drm buddy alloc > + * Scope: drm subsystem > + * Mega feature: drm > + * Feature: buddy_alloc > + * > + * KTEST_TEST: drm_test_buddy_alloc_%s > + * Description: Run DRM buddy allocation %arg[1] test > + * > + * arg[1].values: limit, range, optimistic, smoke, pathological > + */ > + I apologize that the last email included a HTML attachment of the message. Just in case anyone was unable to receive the last email here is a copy of the message: Hi! This is such a cool patch series. I just have a few comments related to the output. In the html output the tests are listed as: ktest@drm_buddy_test@... I wonder if instead of using the file name of "drm_buddy_test" this could possibly be the suite name, "drm_buddy", as this is what users will call when using kunit.py to run the tests. Although "drm_buddy_test" is also the module name so I don't mind it too much. But in the future the file name and module name are not guaranteed to be the same for other tests. Most preferably, there would be a reference to the kunit suite name, file name, and the module name. This may be difficult to implement as these can all differ. I am currently working on the KUnit Attribute framework which saves the module name and I am thinking about also saving the file path as a future attribute. This could be a helpful framework for the KUnit tests specifically. I am not sure how easy it would be to access c objects/functions using this system. Finally, I was wondering if it is the intention to put a list of all KUnit tests that use this new feature into tests/kunit.rst or would this be broken up in some way. Thanks! -Rae > static struct kunit_case drm_buddy_tests[] =3D { > KUNIT_CASE(drm_test_buddy_alloc_limit), > KUNIT_CASE(drm_test_buddy_alloc_range), > -- > 2.40.1 >