Patchwork [PATCHv2] tests: introduce new target tests in Makefile

login
register
mail settings
Submitter Shevchenko Andriy (EXT-Teleca/Helsinki)
Date April 5, 2011, 3:03 p.m.
Message ID <2016ea1c9296efd368a37e4f869bd8a51f20c537.1302015688.git.ext-andriy.shevchenko@nokia.com>
Download mbox | patch
Permalink /patch/89886/
State New
Headers show

Comments

Shevchenko Andriy (EXT-Teleca/Helsinki) - April 5, 2011, 3:03 p.m.
This patch appends Makefile to the tests subdirectory and introduces tests
target in the root Makefile.

Additionally the clean target removes temporary stuff under tests subdirectory
as well.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
 Makefile       |    7 ++++++-
 tests/Makefile |    8 ++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)
 create mode 100644 tests/Makefile
Artem Bityutskiy - April 6, 2011, 8:53 a.m.
On Tue, 2011-04-05 at 18:03 +0300, Andy Shevchenko wrote:
> This patch appends Makefile to the tests subdirectory and introduces tests
> target in the root Makefile.
> 
> Additionally the clean target removes temporary stuff under tests subdirectory
> as well.
> 
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>

Looks good for me, I'll wait a bit and if no one objects, will push it.
Florian Fainelli - April 6, 2011, 9:04 a.m.
Hello,

On Wednesday 06 April 2011 10:53:17 Artem Bityutskiy wrote:
> On Tue, 2011-04-05 at 18:03 +0300, Andy Shevchenko wrote:
> > This patch appends Makefile to the tests subdirectory and introduces
> > tests target in the root Makefile.
> > 
> > Additionally the clean target removes temporary stuff under tests
> > subdirectory as well.
> > 
> > Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> 
> Looks good for me, I'll wait a bit and if no one objects, will push it.

Looks good for me as well, thank you!
--
Florian
Artem Bityutskiy - April 7, 2011, 10:44 a.m.
On Tue, 2011-04-05 at 18:03 +0300, Andy Shevchenko wrote:
> This patch appends Makefile to the tests subdirectory and introduces tests
> target in the root Makefile.
> 
> Additionally the clean target removes temporary stuff under tests subdirectory
> as well.
> 
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> ---
>  Makefile       |    7 ++++++-
>  tests/Makefile |    8 ++++++++
>  2 files changed, 14 insertions(+), 1 deletions(-)
>  create mode 100644 tests/Makefile

Breaks compilation for me:

[dedekind@eru mtd-utils (master)]$ make
d=lib_all; \
        t=`echo $d | sed s:.*_::` d=`echo $d | sed s:_.*::`; \
        make BUILDDIR=/home/dedekind/git/mtd-utils/$d -C $d $t
make[1]: Entering directory `/home/dedekind/git/mtd-utils/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/dedekind/git/mtd-utils/lib'
ar crv /home/dedekind/git/mtd-utils/lib/libmtd.a subdirs_lib_all
ar: subdirs_lib_all: No such file or directory
make: *** [/home/dedekind/git/mtd-utils/lib/libmtd.a] Error 1

Patch

diff --git a/Makefile b/Makefile
index 7ab9743..b4d4170 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@  ifeq ($(WITHOUT_XATTR), 1)
 endif
 
 SUBDIRS = lib ubi-utils mkfs.ubifs
+TESTS = tests
 
 TARGETS = ftl_format flash_erase nanddump doc_loadbios \
 	ftl_check mkfs.jffs2 flash_lock flash_unlock flash_info \
@@ -38,6 +39,7 @@  ifneq ($(BUILDDIR),$(CURDIR))
 endif
 endif
 endif
+	$(MAKE) -C $(TESTS) clean
 
 $(SYMLINKS):
 	ln -sf ../fs/jffs2/$@ $@
@@ -52,10 +54,13 @@  $(BUILDDIR)/jffs2reader: $(BUILDDIR)/jffs2reader.o
 LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
 LDLIBS_jffs2reader  = -lz -llzo2
 
-$(BUILDDIR)/lib/libmtd.a: subdirs_lib_all ;
+$(BUILDDIR)/lib/libmtd.a: subdirs_lib_all
 
 install:: ${TARGETS} ${SCRIPTS}
 	mkdir -p ${DESTDIR}/${SBINDIR}
 	install -m 0755 ${TARGETS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
 	mkdir -p ${DESTDIR}/${MANDIR}/man1
 	gzip -9c mkfs.jffs2.1 > ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz
+
+tests::
+	$(MAKE) -C $(TESTS)
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)