build: enable building & running tests from a subdir

During dpkg build, in a subdir, it is currently not possible to run
tests. Building testsuite/modules due to non-existance of the
testsuite directory under the build dir. Thus create it, when it is
not there.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
This commit is contained in:
Dimitri John Ledkov 2021-06-24 14:53:56 +01:00 committed by Lucas De Marchi
parent 16c086f48c
commit 09ad860552
1 changed files with 1 additions and 0 deletions

View File

@ -255,6 +255,7 @@ CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) &
build-module-playground:
$(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \
$(RM) -rf testsuite/module-playground && \
mkdir -p testsuite/ && \
cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \
find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \
fi