[lkml]   [2019]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v2] libnvdimm: Enable unit test infrastructure compile checks
The infrastructure to mock core libnvdimm routines for unit testing
purposes is prone to bitrot relative to refactoring of that core.
Arrange for the unit test core to be built when CONFIG_COMPILE_TEST=y.
This does not result in a functional unit test environment, it is only a
helper for 0day to catch unit test build regressions.

Note that there are a few x86isms in the implementation, so this does
not bother compile testing this architectures other than 64-bit x86.

Cc: Jérôme Glisse <>
Cc: Jason Gunthorpe <>
Reported-by: Christoph Hellwig <>
Signed-off-by: Dan Williams <>
Changes since v1:
- 0day reports this fails to compile on !x86 which is not surprising.
Just disable non-x86 builds.

drivers/nvdimm/Kconfig | 11 +++++++++++
drivers/nvdimm/Makefile | 4 ++++
2 files changed, 15 insertions(+)

diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig
index 54500798f23a..f6623e807fb2 100644
--- a/drivers/nvdimm/Kconfig
+++ b/drivers/nvdimm/Kconfig
@@ -118,4 +118,15 @@ config NVDIMM_KEYS

+ bool "Build the unit test core"
+ depends on COMPILE_TEST && X86_64
+ default COMPILE_TEST
+ help
+ Build the core of the unit test infrastructure. The result of
+ this build is non-functional for unit test execution, but it
+ otherwise helps catch build errors induced by changes to the
+ core devm_memremap_pages() implementation and other
+ infrastructure.
diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile
index 6f2a088afad6..40080c120363 100644
--- a/drivers/nvdimm/Makefile
+++ b/drivers/nvdimm/Makefile
@@ -28,3 +28,7 @@ libnvdimm-$(CONFIG_BTT) += btt_devs.o
libnvdimm-$(CONFIG_NVDIMM_PFN) += pfn_devs.o
libnvdimm-$(CONFIG_NVDIMM_DAX) += dax_devs.o
libnvdimm-$(CONFIG_NVDIMM_KEYS) += security.o
+TOOLS := ../../tools
+TEST_SRC := $(TOOLS)/testing/nvdimm/test
 \ /
  Last update: 2019-06-19 21:39    [W:0.027 / U:6.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site