Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
* [RESEND PATCH v7 linux-kselftest-test 0/6] kunit: support building core/tests as modules
@ 2020-01-06 22:28 Alan Maguire
  2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Alan Maguire @ 2020-01-06 22:28 UTC (permalink / raw)
  To: shuah, brendanhiggins, linux-kselftest
  Cc: linux-kernel, kunit-dev, keescook, yzaikin, akpm,
	yamada.masahiro, catalin.marinas, joe.lawrence, penguin-kernel,
	urezki, andriy.shevchenko, corbet, davidgow, adilger.kernel,
	tytso, mcgrof, linux-doc, Alan Maguire

The current kunit execution model is to provide base kunit functionality
and tests built-in to the kernel.  The aim of this series is to allow
building kunit itself and tests as modules.  This in turn allows a
simple form of selective execution; load the module you wish to test.
In doing so, kunit itself (if also built as a module) will be loaded as
an implicit dependency.

Because this requires a core API modification - if a module delivers
multiple suites, they must be declared with the kunit_test_suites()
macro - we're proposing this patch set as a candidate to be applied to the
test tree before too many kunit consumers appear.  We attempt to deal
with existing consumers in patch 3.

Changes since v6:
 - reintroduce kunit_test_suite() definition to handle users in other trees
   not yet converted to using kunit_test_suites() (kbuild error when
   applying patches to ext4/dev tree)
 - modify drivers/base/power/qos-test.c to use kunit_test_suites()
   to register suite.  We do not convert it to support module build now as
   the suite uses a few unexported function; see patch 3 for details.
   
Changes since v5:
 - fixed fs/ext4/Makefile to remove unneeded conditional compilation
   (Iurii, patch 3)
 - added Reviewed-by, Acked-by to patches 3, 4, 5 and 6

Changes since v4:
 - fixed signoff chain to use Co-developed-by: prior to Knut's signoff
   (Stephen, all patches)
 - added Reviewed-by, Tested-by for patches 1, 2, 4 and 6
 - updated comment describing try-catch-impl.h (Stephen, patch 2)
 - fixed MODULE_LICENSEs to be GPL v2 (Stephen, patches 3, 5)
 - added __init to kunit_init() (Stephen, patch 5)

Changes since v3:
 - removed symbol lookup patch for separate submission later
 - removed use of sysctl_hung_task_timeout_seconds (patch 4, as discussed
   with Brendan and Stephen)
 - disabled build of string-stream-test when CONFIG_KUNIT_TEST=m; this
   is to avoid having to deal with symbol lookup issues
 - changed string-stream-impl.h back to string-stream.h (Brendan)
 - added module build support to new list, ext4 tests

Changes since v2:
 - moved string-stream.h header to lib/kunit/string-stream-impl.h (Brendan)
   (patch 1)
 - split out non-exported interfaces in try-catch-impl.h (Brendan)
   (patch 2)
 - added kunit_find_symbol() and KUNIT_INIT_SYMBOL to lookup non-exported
   symbols (patches 3, 4)
 - removed #ifdef MODULE around module licenses (Randy, Brendan, Andy)
   (patch 4)
 - replaced kunit_test_suite() with kunit_test_suites() rather than
   supporting both (Brendan) (patch 4)
 - lookup sysctl_hung_task_timeout_secs as kunit may be built as a module
   and the symbol may not be available (patch 5)

Alan Maguire (6):
  kunit: move string-stream.h to lib/kunit
  kunit: hide unexported try-catch interface in try-catch-impl.h
  kunit: allow kunit tests to be loaded as a module
  kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds
  kunit: allow kunit to be loaded as a module
  kunit: update documentation to describe module-based build

 Documentation/dev-tools/kunit/faq.rst              |  3 +-
 Documentation/dev-tools/kunit/index.rst            |  3 ++
 Documentation/dev-tools/kunit/usage.rst            | 16 ++++++++++
 drivers/base/power/qos-test.c                      |  2 +-
 fs/ext4/Kconfig                                    |  2 +-
 fs/ext4/Makefile                                   |  3 +-
 fs/ext4/inode-test.c                               |  4 ++-
 include/kunit/assert.h                             |  3 +-
 include/kunit/test.h                               | 37 ++++++++++++++++------
 include/kunit/try-catch.h                          | 10 ------
 kernel/sysctl-test.c                               |  4 ++-
 lib/Kconfig.debug                                  |  4 +--
 lib/kunit/Kconfig                                  |  6 ++--
 lib/kunit/Makefile                                 | 14 +++++---
 lib/kunit/assert.c                                 | 10 ++++++
 lib/kunit/{example-test.c => kunit-example-test.c} |  4 ++-
 lib/kunit/{test-test.c => kunit-test.c}            |  7 ++--
 lib/kunit/string-stream-test.c                     |  5 +--
 lib/kunit/string-stream.c                          |  3 +-
 {include => lib}/kunit/string-stream.h             |  0
 lib/kunit/test.c                                   | 25 ++++++++++++++-
 lib/kunit/try-catch-impl.h                         | 27 ++++++++++++++++
 lib/kunit/try-catch.c                              | 37 +++++-----------------
 lib/list-test.c                                    |  4 ++-
 24 files changed, 160 insertions(+), 73 deletions(-)
 rename lib/kunit/{example-test.c => kunit-example-test.c} (97%)
 rename lib/kunit/{test-test.c => kunit-test.c} (98%)
 rename {include => lib}/kunit/string-stream.h (100%)
 create mode 100644 lib/kunit/try-catch-impl.h

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 22:28 [RESEND PATCH v7 linux-kselftest-test 0/6] kunit: support building core/tests as modules Alan Maguire
2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire
2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 2/6] kunit: hide unexported try-catch interface in try-catch-impl.h Alan Maguire
2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module Alan Maguire
2020-01-07 23:03   ` shuah
2020-01-08  9:20     ` Alan Maguire
2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 4/6] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Alan Maguire
2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 5/6] kunit: allow kunit to be loaded as a module Alan Maguire
2020-01-06 22:28 ` [RESEND PATCH v7 linux-kselftest-test 6/6] kunit: update documentation to describe module-based build Alan Maguire

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git