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=-11.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 80DA5C432C0 for ; Tue, 19 Nov 2019 19:16:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C20622442 for ; Tue, 19 Nov 2019 19:16:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eVXKgI2I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727374AbfKSTQ1 (ORCPT ); Tue, 19 Nov 2019 14:16:27 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:42286 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbfKSTQ0 (ORCPT ); Tue, 19 Nov 2019 14:16:26 -0500 Received: by mail-pl1-f193.google.com with SMTP id j12so12275527plt.9 for ; Tue, 19 Nov 2019 11:16:26 -0800 (PST) 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=xNq8z5XtG5KO8tgWaEJzHz1qCmBffX1guY4gM/pjvEA=; b=eVXKgI2IjM93eDDhQ1EynosRG3oZTbq4/39Piic0R6q2ar80FuTCHo/oGwZ/kJzLF0 xi3rp/RH27oeawYS7HnmLIZ8hwnizmGzKd5mhp/2fmEs8QJTcXsj1aoMid9QUtxHh0jS C58KKN9ozkId0OvoJ+Q6Ifv/oyU9uqh/b6SaIpcVeSp8uE/t1CdkzVxUO7YMth0O8b4r z2VYw1HEyrhpRx8pnMcLoxKq0ZnEUglLUXItBaCEv0QyAmC7SuLLiwx+H3AiS+KUFAwI fpL1/FMtHPHFVKxTjdxzZpxwDK43lg+okztQUOt1brBU+5xOnk74uM9BP/mPrkSdb10+ fkqA== 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=xNq8z5XtG5KO8tgWaEJzHz1qCmBffX1guY4gM/pjvEA=; b=PtpJ4ojVU8ml7NgkkgFsUZAZmBiqvdQROayhKRx3x9DvvpGBDO39GDKVFxOfy0pf0C mJbB2vSM1koKlaVhg1u8/Y/2dWgE3pCIweV29fzeVmEZ4CJSdlesqkJOtC8bGv0H4ked uHSFoe7fsMvUVtKK7V7rJK7gY7FGxJp+hVqlLPi8hiLlRCXq55ueJamr18MhbMH6F80J 2b6Yd5TMLUs+pzudEdhdYUOjKn7+g2SuL1KVwlggoA3PTIMRR351tsKsrmjk9MCo7xiX HEqUDt+typAFWwqjfz9kRkXoauNSdhDjs4XaRMpriwvsA6d6wp5+jGnkq5RniPRLSEN9 kXPg== X-Gm-Message-State: APjAAAXPD/+1r47kzKRb6rCVVQHwVRWGoTRhVlAAA960wugaidHbpi56 PBkZdCFIFivxljIlR71Hzai8iSj92KEVQmzUTidgEw== X-Google-Smtp-Source: APXvYqyAfZ8iphdg2LYP5pGF7y4vhTOtVs4nX4gS1JEZemNK7UZsDn+akGWXkMl0CcqMxHIzqs8XhZK+6qvgtASJbBY= X-Received: by 2002:a17:90a:ff02:: with SMTP id ce2mr8519075pjb.117.1574190985408; Tue, 19 Nov 2019 11:16:25 -0800 (PST) MIME-Version: 1.0 References: <1573812972-10529-1-git-send-email-alan.maguire@oracle.com> <1573812972-10529-4-git-send-email-alan.maguire@oracle.com> In-Reply-To: <1573812972-10529-4-git-send-email-alan.maguire@oracle.com> From: Brendan Higgins Date: Tue, 19 Nov 2019 11:16:14 -0800 Message-ID: Subject: Re: [PATCH v4 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module To: Alan Maguire , David Gow , Iurii Zaikin , "Theodore Ts'o" , Kees Cook Cc: Shuah Khan , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , KUnit Development , Andrew Morton , Masahiro Yamada , catalin.marinas@arm.com, joe.lawrence@redhat.com, penguin-kernel@i-love.sakura.ne.jp, schowdary@nvidia.com, urezki@gmail.com, andriy.shevchenko@linux.intel.com, Jonathan Corbet , adilger.kernel@dilger.ca, Luis Chamberlain , changbin.du@intel.com, linux-ext4@vger.kernel.org, "open list:DOCUMENTATION" , Stephen Boyd , Knut Omang Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Nov 15, 2019 at 2:16 AM Alan Maguire wrote: > > As tests are added to kunit, it will become less feasible to execute > all built tests together. By supporting modular tests we provide > a simple way to do selective execution on a running system; specifying > > CONFIG_KUNIT=y > CONFIG_KUNIT_EXAMPLE_TEST=m > > ...means we can simply "insmod example-test.ko" to run the tests. > > To achieve this we need to do the following: > > o export the required symbols in kunit > o string-stream tests utilize non-exported symbols so for now we skip > building them when CONFIG_KUNIT_TEST=m. > o support a new way of declaring test suites. Because a module cannot > do multiple late_initcall()s, we provide a kunit_test_suites() macro > to declare multiple suites within the same module at once. > o some test module names would have been too general ("test-test" > and "example-test" for kunit tests, "inode-test" for ext4 tests); > rename these as appropriate ("kunit-test", "kunit-example-test" > and "ext4-inode-test" respectively). Hmm...should we maybe apply this naming scheme to all the tests then? I think Kees might have suggested this. I am actually not sure whether or not we should and would like to get other people's input. It is a valid point that test-test or example-test are too general of names for modules, but if this is the case, I think that inode-test is probably too general as well. But if we are going that far, maybe we should rename everything *-kunit-test.c. > Signed-off-by: Alan Maguire > Signed-off-by: Knut Omang > --- > fs/ext4/Kconfig | 2 +- > fs/ext4/Makefile | 5 + > fs/ext4/inode-test.c | 4 +- > include/kunit/test.h | 35 +++-- > kernel/sysctl-test.c | 4 +- > lib/Kconfig.debug | 4 +- > lib/kunit/Kconfig | 4 +- > lib/kunit/Makefile | 10 +- > lib/kunit/assert.c | 8 + > lib/kunit/example-test.c | 88 ----------- > lib/kunit/kunit-example-test.c | 90 +++++++++++ > lib/kunit/kunit-test.c | 334 +++++++++++++++++++++++++++++++++++++++++ > lib/kunit/string-stream-test.c | 2 +- > lib/kunit/test-test.c | 333 ---------------------------------------- > lib/kunit/test.c | 8 + > lib/kunit/try-catch.c | 2 + > lib/list-test.c | 4 +- > 17 files changed, 494 insertions(+), 443 deletions(-) > delete mode 100644 lib/kunit/example-test.c > create mode 100644 lib/kunit/kunit-example-test.c > create mode 100644 lib/kunit/kunit-test.c > delete mode 100644 lib/kunit/test-test.c