Patchwork [PATCHv1,2/3] tests: build tests by default

login
register
mail settings
Submitter Shevchenko Andriy (EXT-Teleca/Helsinki)
Date April 5, 2011, 11:33 a.m.
Message ID <d47b1aaa839631e454cbfeb14684ca851d941d43.1302002802.git.ext-andriy.shevchenko@nokia.com>
Download mbox | patch
Permalink /patch/89823/
State New
Headers show

Comments

Shevchenko Andriy (EXT-Teleca/Helsinki) - April 5, 2011, 11:33 a.m.
Also, append Makefile to the tests subdirectory.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
 Makefile       |    4 ++--
 tests/Makefile |    8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 tests/Makefile
Josh Boyer - April 5, 2011, 12:44 p.m.
On Tue, Apr 5, 2011 at 7:33 AM, Andy Shevchenko
<ext-andriy.shevchenko@nokia.com> wrote
>
> -install:: ${TARGETS} ${SCRIPTS}
> +install:: ${TARGETS} ${SCRIPTS} tests
>        mkdir -p ${DESTDIR}/${SBINDIR}
>        install -m 0755 ${TARGETS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
>        mkdir -p ${DESTDIR}/${MANDIR}/man1
> diff --git a/tests/Makefile b/tests/Makefile
> new file mode 100644
> index 0000000..05b37e9
> --- /dev/null
> +++ b/tests/Makefile
> @@ -0,0 +1,8 @@
> +
> +SUBDIRS = checkfs fs-tests jittertest ubi-tests
> +
> +all clean tests: $(SUBDIRS)
> +
> +.PHONY: $(SUBDIRS)
> +$(SUBDIRS):
> +       $(MAKE) -C $@ $(MAKECMDGOALS)

We don't want the tests installed by default, do we?  If we do for
some reason, it might be better to stick them in
/usr/libexec/mtd-utils/ or /usr/share/mtd-utils/ or something.  I
doubt we need them sitting in /usr/sbin,/sbin,/bin,/usr/bin on 99% of
the installs.

josh
Artem Bityutskiy - April 5, 2011, 12:45 p.m.
On Tue, 2011-04-05 at 08:44 -0400, Josh Boyer wrote:
> On Tue, Apr 5, 2011 at 7:33 AM, Andy Shevchenko
> <ext-andriy.shevchenko@nokia.com> wrote
> >
> > -install:: ${TARGETS} ${SCRIPTS}
> > +install:: ${TARGETS} ${SCRIPTS} tests
> >        mkdir -p ${DESTDIR}/${SBINDIR}
> >        install -m 0755 ${TARGETS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
> >        mkdir -p ${DESTDIR}/${MANDIR}/man1
> > diff --git a/tests/Makefile b/tests/Makefile
> > new file mode 100644
> > index 0000000..05b37e9
> > --- /dev/null
> > +++ b/tests/Makefile
> > @@ -0,0 +1,8 @@
> > +
> > +SUBDIRS = checkfs fs-tests jittertest ubi-tests
> > +
> > +all clean tests: $(SUBDIRS)
> > +
> > +.PHONY: $(SUBDIRS)
> > +$(SUBDIRS):
> > +       $(MAKE) -C $@ $(MAKECMDGOALS)
> 
> We don't want the tests installed by default, do we?  If we do for
> some reason, it might be better to stick them in
> /usr/libexec/mtd-utils/ or /usr/share/mtd-utils/ or something.  I
> doubt we need them sitting in /usr/sbin,/sbin,/bin,/usr/bin on 99% of
> the installs.

I agree that installing tests should be a separate option.
Florian Fainelli - April 5, 2011, 12:57 p.m.
On Tuesday 05 April 2011 14:44:24 Josh Boyer wrote:
> On Tue, Apr 5, 2011 at 7:33 AM, Andy Shevchenko
> <ext-andriy.shevchenko@nokia.com> wrote
> 
> > -install:: ${TARGETS} ${SCRIPTS}
> > +install:: ${TARGETS} ${SCRIPTS} tests
> >        mkdir -p ${DESTDIR}/${SBINDIR}
> >        install -m 0755 ${TARGETS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
> >        mkdir -p ${DESTDIR}/${MANDIR}/man1
> > diff --git a/tests/Makefile b/tests/Makefile
> > new file mode 100644
> > index 0000000..05b37e9
> > --- /dev/null
> > +++ b/tests/Makefile
> > @@ -0,0 +1,8 @@
> > +
> > +SUBDIRS = checkfs fs-tests jittertest ubi-tests
> > +
> > +all clean tests: $(SUBDIRS)
> > +
> > +.PHONY: $(SUBDIRS)
> > +$(SUBDIRS):
> > +       $(MAKE) -C $@ $(MAKECMDGOALS)
> 
> We don't want the tests installed by default, do we?  If we do for
> some reason, it might be better to stick them in
> /usr/libexec/mtd-utils/ or /usr/share/mtd-utils/ or something.  I
> doubt we need them sitting in /usr/sbin,/sbin,/bin,/usr/bin on 99% of
> the installs.

Most embedded distributions would prefer tests to be disabled by default.

If this is absolutely required, they should still be built as a separate Make 
target.
--
Florian

Patch

diff --git a/Makefile b/Makefile
index 7ab9743..7269c6a 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@  ifeq ($(WITHOUT_XATTR), 1)
   CPPFLAGS += -DWITHOUT_XATTR
 endif
 
-SUBDIRS = lib ubi-utils mkfs.ubifs
+SUBDIRS = lib ubi-utils mkfs.ubifs tests
 
 TARGETS = ftl_format flash_erase nanddump doc_loadbios \
 	ftl_check mkfs.jffs2 flash_lock flash_unlock flash_info \
@@ -54,7 +54,7 @@  LDLIBS_jffs2reader  = -lz -llzo2
 
 $(BUILDDIR)/lib/libmtd.a: subdirs_lib_all ;
 
-install:: ${TARGETS} ${SCRIPTS}
+install:: ${TARGETS} ${SCRIPTS} tests
 	mkdir -p ${DESTDIR}/${SBINDIR}
 	install -m 0755 ${TARGETS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
 	mkdir -p ${DESTDIR}/${MANDIR}/man1
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..05b37e9
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,8 @@ 
+
+SUBDIRS = checkfs fs-tests jittertest ubi-tests
+
+all clean tests: $(SUBDIRS)
+
+.PHONY: $(SUBDIRS)
+$(SUBDIRS):
+	$(MAKE) -C $@ $(MAKECMDGOALS)