linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 linux-kselftest-test 0/6] kunit: support building core/tests as modules
@ 2019-11-15 10:16 Alan Maguire
  2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Alan Maguire @ 2019-11-15 10:16 UTC (permalink / raw)
  To: brendanhiggins, skhan, linux-kselftest
  Cc: linux-kernel, kunit-dev, keescook, yzaikin, akpm,
	yamada.masahiro, catalin.marinas, joe.lawrence, penguin-kernel,
	schowdary, urezki, andriy.shevchenko, corbet, tytso,
	adilger.kernel, mcgrof, changbin.du, linux-ext4, linux-doc,
	sboyd, 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 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 ++
 fs/ext4/Kconfig                         |   2 +-
 fs/ext4/Makefile                        |   5 +
 fs/ext4/inode-test.c                    |   4 +-
 include/kunit/assert.h                  |   3 +-
 include/kunit/string-stream.h           |  51 -----
 include/kunit/test.h                    |  35 +++-
 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                |  88 ---------
 lib/kunit/kunit-example-test.c          |  90 +++++++++
 lib/kunit/kunit-test.c                  | 334 ++++++++++++++++++++++++++++++++
 lib/kunit/string-stream-test.c          |   5 +-
 lib/kunit/string-stream.c               |   3 +-
 lib/kunit/string-stream.h               |  51 +++++
 lib/kunit/test-test.c                   | 331 -------------------------------
 lib/kunit/test.c                        |  25 ++-
 lib/kunit/try-catch-impl.h              |  28 +++
 lib/kunit/try-catch.c                   |  37 +---
 lib/list-test.c                         |   4 +-
 26 files changed, 628 insertions(+), 538 deletions(-)
 delete mode 100644 include/kunit/string-stream.h
 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
 create mode 100644 lib/kunit/string-stream.h
 delete mode 100644 lib/kunit/test-test.c
 create mode 100644 lib/kunit/try-catch-impl.h

-- 
1.8.3.1


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

end of thread, other threads:[~2019-11-20 13:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 10:16 [PATCH v4 linux-kselftest-test 0/6] kunit: support building core/tests as modules Alan Maguire
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire
2019-11-17  1:33   ` Stephen Boyd
2019-11-19 18:36     ` Brendan Higgins
2019-11-19 18:39   ` Brendan Higgins
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 2/6] kunit: hide unexported try-catch interface in try-catch-impl.h Alan Maguire
2019-11-17  1:36   ` Stephen Boyd
2019-11-18 17:30     ` Alan Maguire
2019-11-19 18:48   ` Brendan Higgins
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module Alan Maguire
2019-11-19 19:16   ` Brendan Higgins
2019-11-20 13:56     ` Alan Maguire
2019-11-19 21:05   ` Stephen Boyd
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 4/6] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Alan Maguire
2019-11-18 22:09   ` Luis Chamberlain
2019-11-19  1:24     ` Brendan Higgins
2019-11-19 21:06   ` Stephen Boyd
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 5/6] kunit: allow kunit to be loaded as a module Alan Maguire
2019-11-19 21:13   ` Stephen Boyd
2019-11-20 13:46     ` Alan Maguire
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 6/6] kunit: update documentation to describe module-based build Alan Maguire
2019-11-19 21:15   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).