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=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 CB3E7C433B4 for ; Wed, 7 Apr 2021 22:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CC3F6121E for ; Wed, 7 Apr 2021 22:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229540AbhDGWqZ (ORCPT ); Wed, 7 Apr 2021 18:46:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbhDGWqX (ORCPT ); Wed, 7 Apr 2021 18:46:23 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98452C061760 for ; Wed, 7 Apr 2021 15:46:11 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id a8so147246oic.11 for ; Wed, 07 Apr 2021 15:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8LyLxGSQQphLnjeYLlddmkfUqatoN6oCK+jULyo25+I=; b=cqNnST/xDb7Jic5n81TJ7veTJqiuUrZpTxheT/XoPbOwWZAWAjb1oTobsghTVqVYzH jH4ArgLVqUlkx1eM3HFmCMa3oaWi3qy2Dj8y14jAaBjIRmvTtckS90N28Gb/fLAKfbO8 w/WeHFa6qM/gbYgSvy+cuSc1/dnutMwN2/J+I= 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=8LyLxGSQQphLnjeYLlddmkfUqatoN6oCK+jULyo25+I=; b=sSC8+m2LCCwOXQ/HeZn2yFEJe+zysAryZR1vDSVGXx+vF+ZCHB8mBqN43mQAFPyIJY H2ZOdBJynrtYHBoN7yC/1qq4d7iZNj2vwwtCsutJl+ZLiX3z5GbMl1dOGnIBLVoV4nMv +UVqI0AB0u4K/779iEVh+EPkWYRCTuDkKgjthX+Se7MlvMfOkk/KyMeb2BAcp869AX3e KfKOXWbrulTxtz+AxG6dUfOSNl7I7PhJwPOLAnv9namsLeKxyNvs3Og3Dbz1P5VfMWs5 TGv3lLeaDkxXZenBjiRSzFWRv2PS/tUUP+42oSeT0eSdRmULe6JD/irZrK2NPhWQermf n84g== X-Gm-Message-State: AOAM530tSoc9sUHqcPUp9Y16f4PaBWVZUTW287DTdX6H8p+AoUpOISwc B7L+IPey+UurjnmqsAv9TNw2NQ== X-Google-Smtp-Source: ABdhPJymyx49DOIBzLpDgXw+PDyza1nyktZGIAn1HVJ78ILT8bElG0nl9n8yik3+1y2UBR6iMashug== X-Received: by 2002:aca:4e55:: with SMTP id c82mr3860158oib.43.1617835570974; Wed, 07 Apr 2021 15:46:10 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id s21sm4988229oos.5.2021.04.07.15.46.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Apr 2021 15:46:10 -0700 (PDT) Subject: Re: [PATCH] Documentation: kunit: add tips for using current->kunit_test To: Brendan Higgins , Daniel Latypov Cc: David Gow , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan References: <20210406225100.1883967-1-dlatypov@google.com> From: Shuah Khan Message-ID: <1b7d8261-b501-c118-3bed-9b80983218cb@linuxfoundation.org> Date: Wed, 7 Apr 2021 16:46:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/7/21 2:07 PM, Brendan Higgins wrote: > On Tue, Apr 6, 2021 at 3:51 PM Daniel Latypov wrote: >> >> As of commit 359a376081d4 ("kunit: support failure from dynamic analysis >> tools"), we can use current->kunit_test to find the current kunit test. >> >> Mention this in tips.rst and give an example of how this can be used in >> conjunction with `test->priv` to pass around state and specifically >> implement something like mocking. >> There's a lot more we could go into on that topic, but given that >> example is already longer than every other "tip" on this page, we just >> point to the API docs and leave filling in the blanks as an exercise to >> the reader. >> >> Also give an example of kunit_fail_current_test(). >> >> Signed-off-by: Daniel Latypov > > Reviewed-by: Brendan Higgins > Thank you. Applied to linux-kseftest kunit branch for 5.13-rc1 thanks, -- Shuah