From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-24.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFD75C47089 for ; Wed, 26 May 2021 18:35:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A13E4613EC for ; Wed, 26 May 2021 18:35:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235537AbhEZSh3 (ORCPT ); Wed, 26 May 2021 14:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233845AbhEZSh2 (ORCPT ); Wed, 26 May 2021 14:37:28 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA346C061574 for ; Wed, 26 May 2021 11:35:55 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id f75-20020a1c1f4e0000b0290171001e7329so1079782wmf.1 for ; Wed, 26 May 2021 11:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vuU9uxld5nybVEuq54B8tCkV+pAQVJ8LqfwpbN9ssnI=; b=heAyaGdCvp3mMqZB2Kc8WJb2O2x5cbxLKQHEn+vo/nEIIgV2DsObPDSo7ammdypyhI zXRogNNmo/YXBrctMUND1xiaaTrZKTamN+xrenzv30uNYWFsdWK2p0ARL64k4JDYY0YV fJg+Z1IyF7RmqvvgCperjmWFzxc66+HJ5fBaAwV1CQVfm+0bX9WmgKD+mGSbfdmT0E/v WV2w4eHShBFneFwCwjxaFL+ELVrytLh0S9QCDnTNoeH9cJ0nhiNh7QCU4e91Iq2UCmZg YQDYH+ImchezeFeBknlmzbzVgbqfMNugLvp2RwQ2TQQRKwidQTzX6ylyVmIpgWkv3VtH 3ahQ== 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:user-agent; bh=vuU9uxld5nybVEuq54B8tCkV+pAQVJ8LqfwpbN9ssnI=; b=X/lD65VoiXliGQunepEcdLP0fwSVuDyjVNfmcdXc+IvjReku1ljZ4+BZox1txvww9p 560DwL2oE+hCTe4CH23+qDVk7YxFgi+V+3SRIzJQ7ShsqpX9BR2uzfNPjAkDIToOYDBW Q2/eZATIizcLFA/VPDx509kZnX3QxC9lBGhMUpeU6ykP/KR0lIIaC79LaLkwbeIPfNxy 3s2kXdTGjgXmOSjTwEQNir8+iO1Gg3b47knQXk6cDwC1qAYoiwloFN4Tl2AQHyriK9eU 0iYXnHM2IoGjkONON8WPrL/v+UPaARILubxlV53ChgynIHOYLV9Qt/KDJB0TIRYPQNl0 Atig== X-Gm-Message-State: AOAM530gmX32uBlkOv7H/CHkFnZ66hp6pCMjI8G/s5rjcikTlW3FCXQi P2qvXSYSR9L0AEitxexQUPVgOw== X-Google-Smtp-Source: ABdhPJyQY225rKyYNsyDEonRZZWTlFhAm5I+xmisJQw10qIevpIIa4O4M+3Dkkhl5nMycL7W8AgpJw== X-Received: by 2002:a7b:c92e:: with SMTP id h14mr30129864wml.179.1622054154106; Wed, 26 May 2021 11:35:54 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:15:13:74ba:ff42:8494:7f35]) by smtp.gmail.com with ESMTPSA id t14sm4914507wra.60.2021.05.26.11.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 11:35:53 -0700 (PDT) Date: Wed, 26 May 2021 20:35:47 +0200 From: Marco Elver To: Daniel Latypov Cc: David Gow , Brendan Higgins , Alan Maguire , Shuah Khan , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List Subject: Re: [PATCH 3/3] kunit: test: Add example_skip test suite which is always skipped Message-ID: References: <20210526081112.3652290-1-davidgow@google.com> <20210526081112.3652290-3-davidgow@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.5 (2021-01-21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 26, 2021 at 11:29AM -0700, Daniel Latypov wrote: > On Wed, May 26, 2021 at 1:56 AM 'Marco Elver' via KUnit Development > wrote: > > > > On Wed, May 26, 2021 at 01:11AM -0700, David Gow wrote: > > > Add a new KUnit test suite which contains tests which are always > > > skipped. This is used as an example for how to write tests which are > > > skipped, and to demonstrate the difference between kunit_skip() and > > > kunit_mark_skipped(). > > > > > > Because these tests do not pass (they're skipped), they are not enabled > > > by default, or by the KUNIT_ALL_TESTS config option: they must be > > > enabled explicitly by setting CONFIG_KUNIT_EXAMPLE_SKIP_TEST=y in either > > > a .config or .kunitconfig file. > > > > > > Signed-off-by: David Gow > > > --- > > > lib/kunit/Kconfig | 15 +++++++++ > > > lib/kunit/Makefile | 2 ++ > > > lib/kunit/kunit-example-skip-test.c | 52 +++++++++++++++++++++++++++++ > > > 3 files changed, 69 insertions(+) > > > create mode 100644 lib/kunit/kunit-example-skip-test.c > > > > I don't know if this test is useful for a user of KUnit. Given it's not > > testing KUnit functionality (I see you added tests that the feature > > works in patch 1/3), but rather a demonstration and therefore dead code. > > I don't think the feature is difficult to understand from the API doc > > text. > > > > Instead, would it be more helpful to add something to > > Documentation/dev-tools/kunit? Or perhaps just add something to > > lib/kunit/kunit-example-test.c? It'd avoid introducing more Kconfig > > I'm in favor of putting it in kunit-example-test.c as well. > > But I hear there was pushback to have a non-passing test in the example? > I guess the fear is that someone will see something that doesn't say > "passed" in the example output and think something has gone wrong? > > Hence this more conservative change. > But I hope that in the absence of any replies in opposition, we can > just keep one example-test.c Maybe I misunderstood, but kunit_skip*() isn't supposed to change the test ok/fail state, right? That's the behaviour I'd expect at least. So if the test case deliberately doesn't change the state, but just skips, it should be fine in example-test.c. Thanks, -- Marco