From patchwork Wed Jun 24 20:55:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 208342 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=-17.6 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, 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 ADEEBC433E1 for ; Wed, 24 Jun 2020 20:58:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D9E52070A for ; Wed, 24 Jun 2020 20:58:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ur1fLf5i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389500AbgFXU6P (ORCPT ); Wed, 24 Jun 2020 16:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389295AbgFXU6N (ORCPT ); Wed, 24 Jun 2020 16:58:13 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DDECC061573 for ; Wed, 24 Jun 2020 13:58:13 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id p9so2488450qtn.5 for ; Wed, 24 Jun 2020 13:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=9cJ18y40uUPYFZL7TN4SHcIdjwmkZDveAIhoXIvPo38=; b=Ur1fLf5iHlKMYZXC1PTBS+I+vVSZLrwtsudyGKcS4apEjTlQlWHIVHccmjstZTZ2A0 XpAesa/HexpPJ9lkMkGhBnF6Qskxhzu2Ugio6H/p+KIiUclPfy8g1bBrcb7XDtFj1fPA VhqqvTyBMz+4f1As4j6RChLXUWDpJpaCKf8s+VcdwMv144usfln+/z4SjWwh8S8wWOIT zIFXsZgc2COv4+INh8ZCWPZm65Gi+O1lsnv8GiFgvCUD1bjd/Dw8gnuPmXj6lL0ut1uv GSJrpDJHuaTL4yqBLz4GZSN4VLUjQGoPlUwe84SvdDiBJQ8E5KFn34V8W7sRUPNHp5K5 x9Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=9cJ18y40uUPYFZL7TN4SHcIdjwmkZDveAIhoXIvPo38=; b=VF4MJRoiu+997ybqbCMNdrutjNpzcbJwfC8BH6b6PUBEY+b3lOf1Mq0YhStFxHcMWJ ayf9STM+akdhv+muNuQX2zC5+7MsDbNt0lAzMd3JLugffuN9UkMF0bI/YoZjRkiK8gwB HKZh0vrLY1061DwZWIZzMAU2WGaiOIVo5R7+9vw5rj1rDS6Gp+re1i4o9ESc4QjgAE8Z +Ibqxak2v9fblkh3Q4rlS3rCkKFC35TAn+smQXra/s1dIfx58N5jU6ia5qM+kP8t0nkg 3ghjNnC/ZHGLGa7MxFxiMfuZg/jnG22xDcFdcvVFXLJBvnlyFsGmOpDqc47lv7Pci6I7 +Hkw== X-Gm-Message-State: AOAM531qDPgxa+3SbgCTw/hQO4NKWl5WSCuvxDCJoiemDgN71r7rfwOr UdJxsESW2pUisijwKhKCGFeJChr2L54U4ojTb6fwlQ== X-Google-Smtp-Source: ABdhPJxiJGG91wgEwxBBSujXoL0BDsw9UNFVENxNw1T3itcMUFGteR1x45PAf5QA98p+dstOOYTnC7ogGU5jYKFNmTfkvg== X-Received: by 2002:a0c:b346:: with SMTP id a6mr33657229qvf.142.1593032292307; Wed, 24 Jun 2020 13:58:12 -0700 (PDT) Date: Wed, 24 Jun 2020 13:55:41 -0700 In-Reply-To: <20200624205550.215599-1-brendanhiggins@google.com> Message-Id: <20200624205550.215599-3-brendanhiggins@google.com> Mime-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH v4 02/11] arch: arm64: add linker section for KUnit test suites From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, keescook@chromium.org, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com Cc: gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add a linker section to arm64 where KUnit can put references to its test suites. This patch is an early step in transitioning to dispatching all KUnit tests from a centralized executor rather than having each as its own separate late_initcall. Signed-off-by: Brendan Higgins --- arch/arm64/kernel/vmlinux.lds.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 6827da7f3aa54..a1cae9cc655d7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -181,6 +181,9 @@ SECTIONS INIT_RAM_FS *(.init.rodata.* .init.bss) /* from the EFI stub */ } + .kunit_test_suites : { + KUNIT_TEST_SUITES + } .exit.data : { EXIT_DATA } From patchwork Wed Jun 24 20:55:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 208337 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=-17.6 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL 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 D7C91C433E0 for ; Wed, 24 Jun 2020 20:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B87942075A for ; Wed, 24 Jun 2020 20:59:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="r4C8omzl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391619AbgFXU7T (ORCPT ); Wed, 24 Jun 2020 16:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389453AbgFXU6P (ORCPT ); Wed, 24 Jun 2020 16:58:15 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC26FC061573 for ; Wed, 24 Jun 2020 13:58:14 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id j3so3603834yba.14 for ; Wed, 24 Jun 2020 13:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=hiFp+uoptqOZ2rqi90LxI+MqGbDbXrg3yHQVzKDmQQ4=; b=r4C8omzldjna6reCrt2PzuMWWZE3IZ2y3f6lclc933vQMY5LTWLxwFuKexT4JvEe9A iElOlRcRe7ONH9zL0N4HZ5GBzncNZey4G1Aoed+ZlwUMSzmLjxbt1S7d8G7s/Q1XyI78 vPZb6jL2BlxrYw6quFHLcZOJf/UggWPfVY4qEsf4A8F6Bru5l+b/GBLsNWCcwZiYHph+ Dbsa9CXKlN1jQwhe67MA252WId0W7TqOPepmJ+EVxQyaURVV/mC47v+za56p/w4E8JVC 87eyLI9ICUIfZX+noq394fm9wzUFuOaDtYoDrAvqofPlXjDofFz5QEHCCF1kl+6cQ/sl eR1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=hiFp+uoptqOZ2rqi90LxI+MqGbDbXrg3yHQVzKDmQQ4=; b=tI/xI9uWLNEwE6VWBBRoE5lJJ0pZsj5+VJzoVjJktDz8SlGuoF1K64HR+DXC7O4jvG BNnX0rZ5eqdPR8uV18aa6g3ZfiiPHeIAF1AneAB6LBzJrrUTzNKZFnID5VDukRW32n85 LhdQBWcaRURY1fBlU5eOZ+LQOGuo01jkoKKKbQq8u7f7uhjXsQtmmGOsI/wD5edRbF6+ G0r4/3Tv/Sz0JMt3pVdavtbYlgAEzjlgDHfjI+uok4ryAYtnMwqoyYYK1cqMJx0DCZkQ Z+gk4762V/aFPUO2lks+IGoa5Zvl1abZAiEE30pNV131V2XjKLdo2hemBxtOW+QLCgmL efRw== X-Gm-Message-State: AOAM532ZJhfoM8vze7bIWcOTB5+2H4x/04QPoLa5jmv46TIfsr2zcgpJ bd44Ap/lRca9FhaL0OkdS1EnzXfEWuLjYmykd6J1LQ== X-Google-Smtp-Source: ABdhPJzw0PE1cr6miTcf36AU/8/D6CtmczIAUZsitjQKI4FCtj13PFtWbSnnwhEssKH9DHeczUteecQfDP7L+Nwm+WqoHA== X-Received: by 2002:a5b:2c7:: with SMTP id h7mr46550583ybp.162.1593032294101; Wed, 24 Jun 2020 13:58:14 -0700 (PDT) Date: Wed, 24 Jun 2020 13:55:42 -0700 In-Reply-To: <20200624205550.215599-1-brendanhiggins@google.com> Message-Id: <20200624205550.215599-4-brendanhiggins@google.com> Mime-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH v4 03/11] arch: microblaze: add linker section for KUnit test suites From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, keescook@chromium.org, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com Cc: gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add a linker section to microblaze where KUnit can put references to its test suites. This patch is an early step in transitioning to dispatching all KUnit tests from a centralized executor rather than having each as its own separate late_initcall. Signed-off-by: Brendan Higgins --- arch/microblaze/kernel/vmlinux.lds.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index df07b3d06cd6b..4fc32f8979a60 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -128,6 +128,10 @@ SECTIONS { __init_end = .; + .kunit_test_suites : { + KUNIT_TEST_SUITES + } + .bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) { /* page aligned when MMU used */ __bss_start = . ; From patchwork Wed Jun 24 20:55:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 208338 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=-17.6 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL 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 901EDC433E0 for ; Wed, 24 Jun 2020 20:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 693032081A for ; Wed, 24 Jun 2020 20:59:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MyLNvjH4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388964AbgFXU7H (ORCPT ); Wed, 24 Jun 2020 16:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388014AbgFXU6T (ORCPT ); Wed, 24 Jun 2020 16:58:19 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3CF7C061795 for ; Wed, 24 Jun 2020 13:58:18 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id j3so3603973yba.14 for ; Wed, 24 Jun 2020 13:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=hVa5/5YjHA4HA55L6gqApWSV/fHdhhYIjiCaFnqYV3g=; b=MyLNvjH4BaSpMVt4m7OL8w8Kh4XLox5uMmU6/Z0ItdZP4yMrnH98CNwuV3QeifZL92 3Y8tuGJwfcNuWZHxP1UkeqK/xJb1NRFlgtf+ZsZAZxk1HsrR1w7SdO7zb9wvBE1lihXo /gM/39u4cbejNpzreOPpLQs+1yfAKtUU1a9px0EyuTVEN0JzHssKb05XMKZvWoaTlB2G t5NtebZVftxPJvJkT4/iXrbXs6qVYFATI3eRi67iQDiHIAzrHfb/09cLTk76ga0CyglA oHFKXvdwJWazciq0ZtyNXvUR8S40GGOhq2T3LzC+e+3smItGPZh/hoBFWoC5eBtta1xc lXFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=hVa5/5YjHA4HA55L6gqApWSV/fHdhhYIjiCaFnqYV3g=; b=JRWnGrpoiPSjQosgivmQWXBNg/ib8bqLULnGEG9eIQDA5FuBRFxRDdDJcJmEbM5dTW y+8vlkWYjwRBn508Z+ap05ZHGAGzt6ls/VfaNum3Xa7eJA6e2Ps8ohtExIsUArVnXVvt Jc5smvhf3jPcXVca6BIq9HiOQWcM8BOGidxxNrLwxYryf8tlQtyKLOllgkeggtalJjs0 ZnjSbgY8BLQQYnYLVzWAKXnZEuo9a683o2mC9ad5ClunlZKmbvn7NRPPmRam7IL6uzME tyKWfeiShgsgupqZpX7c/arMjqWBJKYmsyUA0Dcd2Z0CrSna0lRmKywHxn3UOIGHbdmF molA== X-Gm-Message-State: AOAM531PoA7tUjy2x2Ajwv/LgmLnwlMPsu2CfotHT9WdqZ+tocnRHofD BaCKq3CVbs9nVY1sfVxxVdsmTZVnK3CRGShz1WcKmQ== X-Google-Smtp-Source: ABdhPJzg+Au4umwjyLRblCRE3PuIJNmc8kxElVJsT/B0YDcGaL41JkWSqA7GJtKTxCWTEEXd8EUt+BFhsEEeVgNcGl0dpQ== X-Received: by 2002:a25:73c3:: with SMTP id o186mr43621885ybc.230.1593032297774; Wed, 24 Jun 2020 13:58:17 -0700 (PDT) Date: Wed, 24 Jun 2020 13:55:44 -0700 In-Reply-To: <20200624205550.215599-1-brendanhiggins@google.com> Message-Id: <20200624205550.215599-6-brendanhiggins@google.com> Mime-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH v4 05/11] arch: um: add linker section for KUnit test suites From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, keescook@chromium.org, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com Cc: gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add a linker section to UML where KUnit can put references to its test suites. This patch is an early step in transitioning to dispatching all KUnit tests from a centralized executor rather than having each as its own separate late_initcall. Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- arch/um/include/asm/common.lds.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S index eca6c452a41bd..9a9c97f45694c 100644 --- a/arch/um/include/asm/common.lds.S +++ b/arch/um/include/asm/common.lds.S @@ -52,6 +52,10 @@ CON_INITCALL } + .kunit_test_suites : { + KUNIT_TEST_SUITES + } + .exitcall : { __exitcall_begin = .; *(.exitcall.exit) From patchwork Wed Jun 24 20:55:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 208339 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=-17.6 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL 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 ECCA4C433DF for ; Wed, 24 Jun 2020 20:58:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6C5C2081A for ; Wed, 24 Jun 2020 20:58:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BxVsCiRl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391452AbgFXU6Y (ORCPT ); Wed, 24 Jun 2020 16:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389744AbgFXU6U (ORCPT ); Wed, 24 Jun 2020 16:58:20 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF24C06179A for ; Wed, 24 Jun 2020 13:58:20 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id g12so2474038qko.19 for ; Wed, 24 Jun 2020 13:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Nq9F0z4123tt4UqM776+npgcQr2vACSfzkMX0VOkyz8=; b=BxVsCiRl31FUZaXeXGi8TV70WMTRIEfLDWFsMjf9VqWbt1aplCwkMUV6du/2DbXHDA nmIqbT++UfoVt2spbm6O4fmSAaacN8xjQv9Vk7mvxhaVZJ9BPTkHJu8aBCdCnIu51P5m wZ24eLo2g5qlSjSP/eIlooA1u/pqdwQEihkdjLYouX/8rVxWrLxhZOX/WQfJheEnbE5o v0W7rWqeaGSn+q7Ev6eTL12tKFayk99cr69qnKqzeZeUGe9TC4veYRnMtqICU6y6UEt0 7wl+R6AWP851Ken+D6iQ9SXiZ9pQ1MwxBJLG5X11cZGeJs5LD4j/ew5gVX1NXLQSps+b CAMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Nq9F0z4123tt4UqM776+npgcQr2vACSfzkMX0VOkyz8=; b=ZuPXWpfNnO26AjZKkcCM4f5Lf5Q3Jg77RMe3YActflTARAsfzZK4zL/8cR+fdkt0z0 XAszgEgP+gKtjYncH/BAFQ+T87vukLvYiAQ5cgmNI5wmt5DxvrUlKvmikiNCv8aVD8Mh 3UJcjgBStSAtbNcoVZ7di/CrF3/onvF0fXHZUfqgC1pH7vjmTNAHMVz7ZgHlH0DVzi+L ICUVssJkr67VFN/xgm5cihO9MLK4psZ9zSEn5OS2MiHuKMS9fUZU+Gpq5rwRQXQvkCA0 WJks2lGrS12G9T+cF3KoGLVQu0HT2OyprD+sBU7naahajn3yBMGJc1+GdKekd1A0YLPb gbcA== X-Gm-Message-State: AOAM530kq29XVvIwbS4Y3Fq+k2JIFgw5ZtKcceiEXg2uMdlfIom/+Q8q L754xitlLjButAwt73mnoPXj4WkkLeHX3AKe3GtdrQ== X-Google-Smtp-Source: ABdhPJzQqVhx61203uYXm1i0yxcc0AnVKozIfTJnOAmP5bxUytYJO1bkE34YZASYNKaxdzL6HRViJV73fScMedut3CXRZg== X-Received: by 2002:a0c:ecc6:: with SMTP id o6mr32877909qvq.243.1593032299582; Wed, 24 Jun 2020 13:58:19 -0700 (PDT) Date: Wed, 24 Jun 2020 13:55:45 -0700 In-Reply-To: <20200624205550.215599-1-brendanhiggins@google.com> Message-Id: <20200624205550.215599-7-brendanhiggins@google.com> Mime-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH v4 06/11] arch: xtensa: add linker section for KUnit test suites From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, keescook@chromium.org, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com Cc: gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add a linker section to xtensa where KUnit can put references to its test suites. This patch is an early step in transitioning to dispatching all KUnit tests from a centralized executor rather than having each as its own separate late_initcall. Signed-off-by: Brendan Higgins --- arch/xtensa/kernel/vmlinux.lds.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index d23a6e38f0625..9aec4ef67d0b0 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -216,6 +216,10 @@ SECTIONS INIT_RAM_FS } + .kunit_test_suites : { + KUNIT_TEST_SUITES + } + PERCPU_SECTION(XCHAL_ICACHE_LINESIZE) /* We need this dummy segment here */ From patchwork Wed Jun 24 20:55:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 208340 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=-17.6 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, 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 A9B7AC433E1 for ; Wed, 24 Jun 2020 20:58:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DC032075A for ; Wed, 24 Jun 2020 20:58:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="P5AXu3Qp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389816AbgFXU6r (ORCPT ); Wed, 24 Jun 2020 16:58:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391526AbgFXU6Y (ORCPT ); Wed, 24 Jun 2020 16:58:24 -0400 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D7AC0617BD for ; Wed, 24 Jun 2020 13:58:22 -0700 (PDT) Received: by mail-qt1-x849.google.com with SMTP id r25so2472636qtj.11 for ; Wed, 24 Jun 2020 13:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=I7yo0yEby7owuH9fjF7jYNE2HNVlDO8rCEj1t0cq5W0=; b=P5AXu3QpqHn80S40NrmgYYI4Mc7UVYu++O/xzJcL4i628UmQU9O+eAjEkw4EPuaHJ6 CG++JqCNHnOzwl+zOs5BZUvuXZjeNXz2WOvm4uufRtGbWP3ZAGXo8h4o3alHX50jRWlN zwcSTqK8TrYeS05krF+CHutg9jnISHDmov3W6yZ+wSlB0TJ0fVRfezXoEX5IfnTkVg2o Ci01L4XPf7KMqzgloSUIQ5HiNaiueVEs5fq8ENCs/mFB0cnWPtkgwj8Im8ieEB1rof6i 2JsXZgqk5Il2GbAgmbaNeQTRDGpuLVfTyFeOJIkb5hup3SaEaDoy2GmxGGNSbur8A8IB 9Jvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=I7yo0yEby7owuH9fjF7jYNE2HNVlDO8rCEj1t0cq5W0=; b=AalKKCShYpq8aCXhLV2GKaOEJkXQsLkDGH1z5vXaFIB/XCvbc4WkV7rB6NVy+zeXVq g6j/Hcz2ZFzxHmrDryEhLqg1SOsE82Wt40Y1oKUWRsPw54fGlrl488RYAJ6vaSVWTBdo IPi+nvg+dxLKHdhH1o6FdFD/JjoMO2hyo6psgYO34CYXWuHs1jR29P62PjSCCaQvgxgC g0ZAauNtCLxHSr7Ok3DDYVDMTgOpzQdRucIQ2TCOtwsBT/v5yiPFolvEIJ8EGJzqQOA3 RzdW5dLr2beEGZl7WsBMcEUcCyW2gyLuiEW23PO2ZyHU4arOIVyVjy0vJnBUtpvTMPU5 x9+Q== X-Gm-Message-State: AOAM5304sSlioM2c7o8IZ2txfPm18P6868imkH2eZC8DRNBJpcDGltPW wW0MAZn/xaax2g0E4UaWnYSes9JWLelSSaJaioKvKg== X-Google-Smtp-Source: ABdhPJxuRK29ERpfOi4lSD1AKlr24E378GidpLS9gMKPqPVrv6sLJ5h9iLdDDykicSL6/+mqMoUkfnz/MS5RbovhvkWTLw== X-Received: by 2002:a05:6214:a6c:: with SMTP id ef12mr13810259qvb.74.1593032301447; Wed, 24 Jun 2020 13:58:21 -0700 (PDT) Date: Wed, 24 Jun 2020 13:55:46 -0700 In-Reply-To: <20200624205550.215599-1-brendanhiggins@google.com> Message-Id: <20200624205550.215599-8-brendanhiggins@google.com> Mime-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH v4 07/11] kunit: test: create a single centralized executor for all tests From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, keescook@chromium.org, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com Cc: gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Alan Maguire Add a centralized executor to dispatch tests rather than relying on late_initcall to schedule each test suite separately. Centralized execution is for built-in tests only; modules will execute tests when loaded. Signed-off-by: Alan Maguire Co-developed-by: Iurii Zaikin Signed-off-by: Iurii Zaikin Co-developed-by: Brendan Higgins Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- include/kunit/test.h | 64 ++++++++++++++++++++++++++++++-------------- lib/kunit/Makefile | 3 ++- lib/kunit/executor.c | 28 +++++++++++++++++++ lib/kunit/test.c | 2 +- 4 files changed, 75 insertions(+), 22 deletions(-) create mode 100644 lib/kunit/executor.c diff --git a/include/kunit/test.h b/include/kunit/test.h index 47e61e1d53370..d13965eb624d4 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -224,7 +224,7 @@ size_t kunit_suite_num_test_cases(struct kunit_suite *suite); unsigned int kunit_test_case_num(struct kunit_suite *suite, struct kunit_case *test_case); -int __kunit_test_suites_init(struct kunit_suite **suites); +int __kunit_test_suites_init(struct kunit_suite * const * const suites); void __kunit_test_suites_exit(struct kunit_suite **suites); @@ -237,34 +237,58 @@ void __kunit_test_suites_exit(struct kunit_suite **suites); * Registers @suites_list with the test framework. See &struct kunit_suite for * more information. * - * When builtin, KUnit tests are all run as late_initcalls; this means - * that they cannot test anything where tests must run at a different init - * phase. One significant restriction resulting from this is that KUnit - * cannot reliably test anything that is initialize in the late_init phase; - * another is that KUnit is useless to test things that need to be run in - * an earlier init phase. - * - * An alternative is to build the tests as a module. Because modules - * do not support multiple late_initcall()s, we need to initialize an - * array of suites for a module. - * - * TODO(brendanhiggins@google.com): Don't run all KUnit tests as - * late_initcalls. I have some future work planned to dispatch all KUnit - * tests from the same place, and at the very least to do so after - * everything else is definitely initialized. + * If a test suite is built-in, module_init() gets translated into + * an initcall which we don't want as the idea is that for builtins + * the executor will manage execution. So ensure we do not define + * module_{init|exit} functions for the builtin case when registering + * suites via kunit_test_suites() below. */ -#define kunit_test_suites(suites_list...) \ - static struct kunit_suite *suites[] = {suites_list, NULL}; \ - static int kunit_test_suites_init(void) \ +#ifdef MODULE +#define kunit_test_suites_for_module(__suites) \ + static int __init kunit_test_suites_init(void) \ { \ + struct kunit_suite *suites[] = (__suites); \ return __kunit_test_suites_init(suites); \ } \ - late_initcall(kunit_test_suites_init); \ + module_init(kunit_test_suites_init); \ + \ static void __exit kunit_test_suites_exit(void) \ { \ return __kunit_test_suites_exit(suites); \ } \ module_exit(kunit_test_suites_exit) +#else +#define kunit_test_suites_for_module(__suites) +#endif /* MODULE */ + +#define __kunit_test_suites(unique_array, unique_suites, ...) \ + static struct kunit_suite *unique_array[] = { __VA_ARGS__, NULL }; \ + kunit_test_suites_for_module(unique_array); \ + static struct kunit_suite **unique_suites \ + __used __section(.kunit_test_suites) = unique_array + +/** + * kunit_test_suites() - used to register one or more &struct kunit_suite + * with KUnit. + * + * @suites: a statically allocated list of &struct kunit_suite. + * + * Registers @suites with the test framework. See &struct kunit_suite for + * more information. + * + * When builtin, KUnit tests are all run via executor; this is done + * by placing the array of struct kunit_suite * in the .kunit_test_suites + * ELF section. + * + * An alternative is to build the tests as a module. Because modules do not + * support multiple initcall()s, we need to initialize an array of suites for a + * module. + * + */ +#define kunit_test_suites(...) \ + __kunit_test_suites(__UNIQUE_ID(array), \ + __UNIQUE_ID(suites), \ + __VA_ARGS__) #define kunit_test_suite(suite) kunit_test_suites(&suite) diff --git a/lib/kunit/Makefile b/lib/kunit/Makefile index 724b94311ca36..c49f4ffb6273a 100644 --- a/lib/kunit/Makefile +++ b/lib/kunit/Makefile @@ -3,7 +3,8 @@ obj-$(CONFIG_KUNIT) += kunit.o kunit-objs += test.o \ string-stream.o \ assert.o \ - try-catch.o + try-catch.o \ + executor.o ifeq ($(CONFIG_KUNIT_DEBUGFS),y) kunit-objs += debugfs.o diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c new file mode 100644 index 0000000000000..7015e7328dce7 --- /dev/null +++ b/lib/kunit/executor.c @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +/* + * These symbols point to the .kunit_test_suites section and are defined in + * include/asm-generic/vmlinux.lds.h, and consequently must be extern. + */ +extern struct kunit_suite * const * const __kunit_suites_start[]; +extern struct kunit_suite * const * const __kunit_suites_end[]; + +#if IS_BUILTIN(CONFIG_KUNIT) + +static int kunit_run_all_tests(void) +{ + struct kunit_suite * const * const *suites; + + for (suites = __kunit_suites_start; + suites < __kunit_suites_end; + suites++) + __kunit_test_suites_init(*suites); + + return 0; +} + +late_initcall(kunit_run_all_tests); + +#endif /* IS_BUILTIN(CONFIG_KUNIT) */ diff --git a/lib/kunit/test.c b/lib/kunit/test.c index ccb2ffad8dcfa..918dff400a9d7 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -380,7 +380,7 @@ static void kunit_init_suite(struct kunit_suite *suite) kunit_debugfs_create_suite(suite); } -int __kunit_test_suites_init(struct kunit_suite **suites) +int __kunit_test_suites_init(struct kunit_suite * const * const suites) { unsigned int i; From patchwork Wed Jun 24 20:55:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 208341 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=-17.6 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, 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 03DC7C433E0 for ; Wed, 24 Jun 2020 20:58:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC09F20A8B for ; Wed, 24 Jun 2020 20:58:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eBb2r/O+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389720AbgFXU6k (ORCPT ); Wed, 24 Jun 2020 16:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391556AbgFXU6b (ORCPT ); Wed, 24 Jun 2020 16:58:31 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6841C061799 for ; Wed, 24 Jun 2020 13:58:29 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 186so3518188yby.19 for ; Wed, 24 Jun 2020 13:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=/YfJhHqk1scz1aBXF0mupkQea8lbBQgP2jeC+IACUDE=; b=eBb2r/O+3xD/ft1cWQIYq+lLT5MaZcDKCI7F68NCZy5mtkJDNhWzHGgMGNZjbp5vY2 NeciIBXPHqDHAr515OD+KEI2SwbSQA3wPry4syrluMYmbIYDoGubxlmgh9jyRlLOoHz5 p4aoDDsXGCW7wnWAlLUMV8zs3lliqsQjwHQ3f/IRxPoalCwAHzoMzbTu3F1aBupYM8jY RJXyTQ3a1l5kZUWbyWsbEikRBkGpV5M+0D3Trh1EaZC6LuABuarRYjnjmK+YSshwXwQu +pk7yF5eODqLsJrD/Gc4h/AznuIk8Jq2hwInTWrfIN5TI1VZdP1CxKJc8TVkKATdArhv rkVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=/YfJhHqk1scz1aBXF0mupkQea8lbBQgP2jeC+IACUDE=; b=Uq5NgqjNQJULLS518gWIoh45W/KT951irDOK/4I94TBt20edPDUYJTqvQ94Q3ECAzy XT68/I7CknODxZ+tY/FN27Y+k6Ed92I4LNpg5WWuPE90BgosX8+YMoznUPnOLox3ERTZ MoxVJrYr9p5te/ItkqIjAs6jx+IiBNqWDGb0bKAlSChhpS7FQYINjyCUVOhGE79m5KZz CGMCevQZAWduWBG2b31+CNvOWYjAbpeO2vPzTVq1TQmP/9s8imqNQeQsM8FJuRsx8C0W HzgXTCx1WAZbAoCMCXYUXDrfW0zwjiOhkJtVMX2uAOz44eDlAh+G7Wl38MR6zAcwkAWC qk/A== X-Gm-Message-State: AOAM533A15XNBGctH2yQmCQLPywLPf5Pt+lE6D4KDBFY2ao7n65QI/JT d4bNdzoI7rsJHEk4Aa+CdqqFbijI5rd0Nn4r0FbTsg== X-Google-Smtp-Source: ABdhPJyzMN1O9F20c44aUZ3Rj+xXWGPWk9fw0REl0xzDcZiFgklg99lb7/rTyyzMpJHoIh8oBhPbhqyjNv0vmkzqL5BxQQ== X-Received: by 2002:a25:2d63:: with SMTP id s35mr27292035ybe.367.1593032308955; Wed, 24 Jun 2020 13:58:28 -0700 (PDT) Date: Wed, 24 Jun 2020 13:55:50 -0700 In-Reply-To: <20200624205550.215599-1-brendanhiggins@google.com> Message-Id: <20200624205550.215599-12-brendanhiggins@google.com> Mime-Version: 1.0 References: <20200624205550.215599-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH v4 11/11] Documentation: kunit: add a brief blurb about kunit_test_suite From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, keescook@chromium.org, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com Cc: gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add a brief blurb saying how and when the kunit_test_suite() macro works to the usage documentation. Signed-off-by: Brendan Higgins --- Documentation/dev-tools/kunit/usage.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst index 3c3fe8b5feccf..961d3ea3ca19a 100644 --- a/Documentation/dev-tools/kunit/usage.rst +++ b/Documentation/dev-tools/kunit/usage.rst @@ -211,6 +211,11 @@ KUnit test framework. .. note:: A test case will only be run if it is associated with a test suite. +``kunit_test_suite(...)`` is a macro which tells the linker to put the specified +test suite in a special linker section so that it can be run by KUnit either +after late_init, or when the test module is loaded (depending on whether the +test was built in or not). + For more information on these types of things see the :doc:`api/test`. Isolating Behavior