Re: [PATCH] libnvdimm: Enable unit test infrastructure compile checks
From: Dan Williams
Date: Wed Jun 19 2019 - 12:32:57 EST
On Wed, Jun 19, 2019 at 4:23 AM Christoph Hellwig <hch@xxxxxx> wrote:
> On Mon, Jun 17, 2019 at 01:52:27PM -0700, Dan Williams wrote:
> > 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.
> Looks fine:
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> I'm still curious what the point of hiding kernel code in tools/
> is vs fully integrating it with the build system.
The separation of tools/ is due to way the "--wrap=" ldflag behaves.
It can only wrap symbols across a module linking boundary. So to
produce a setup where libnvdimm is ingesting faked responses it all
needs to be built as external modules and relinked.
It's an inelegant way to get some test coverage beyond what qemu-kvm
can do, my hope is that down the road I can use the new Kunit
infrastructure to do something similar in a cleaner / more formal way.