[oe-commits] Chong Lu : quilt: enable ptest support

git at git.openembedded.org git at git.openembedded.org
Mon Jan 6 11:29:38 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 45bb0364e5f97e7d99b494df8d13e7f58265159f
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=45bb0364e5f97e7d99b494df8d13e7f58265159f

Author: Chong Lu <Chong.Lu at windriver.com>
Date:   Fri Jan  3 14:51:30 2014 +0800

quilt: enable ptest support

Install quilt test suite and run it as ptest.
Exclude delete.test and mail.test.
delete.test need execute with normal user and mail.test need depend
on mail agent, else these test cases will fail. So exclude them order
to make ptest all pass.

Signed-off-by: Chong Lu <Chong.Lu at windriver.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/recipes-devtools/quilt/quilt-0.61.inc  | 24 ++++++++++++++++++++++--
 meta/recipes-devtools/quilt/quilt/Makefile  | 13 +++++++++++++
 meta/recipes-devtools/quilt/quilt/run-ptest |  5 +++++
 3 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/quilt/quilt-0.61.inc b/meta/recipes-devtools/quilt/quilt-0.61.inc
index 41edebb..f751ac8 100644
--- a/meta/recipes-devtools/quilt/quilt-0.61.inc
+++ b/meta/recipes-devtools/quilt/quilt-0.61.inc
@@ -5,12 +5,15 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 SRC_URI = "http://download.savannah.gnu.org/releases/quilt/quilt-${PV}.tar.gz \
-        file://install.patch"
+        file://install.patch \
+        file://run-ptest \
+        file://Makefile \
+"
 
 SRC_URI[md5sum] = "24417eba5961592b64103bdda001ebf4"
 SRC_URI[sha256sum] = "1eec0a270ac4d41eea0fd5823603c9d2a35ab6b8ab73a90dd92ce1291b2a9fc3"
 
-inherit autotools
+inherit autotools ptest
 
 EXTRA_OECONF_darwin += "--without-date \
                         --without-getopt \
@@ -34,3 +37,20 @@ do_install () {
 	# cleanup unpackaged files
 	rm -rf ${D}/${datadir}/emacs
 }
+
+do_compile_ptest() {
+	oe_runmake bin/patch-wrapper test/.depend
+}
+
+do_install_ptest() {
+	tar -cf - bin/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	tar -cf - compat/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
+                        perl-module-filehandle perl-module-getopt-std \
+                        perl-module-posix perl-module-file-temp \
+"
diff --git a/meta/recipes-devtools/quilt/quilt/Makefile b/meta/recipes-devtools/quilt/quilt/Makefile
new file mode 100644
index 0000000..7b3ac8a
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/Makefile
@@ -0,0 +1,13 @@
+PATH :=         $(CURDIR)/bin:$(CURDIR)/compat:$(PATH)
+QUILT_DIR :=    $(CURDIR)/quilt
+QUILTRC :=      $(CURDIR)/test/test.quiltrc
+export QUILT_DIR QUILTRC
+CHECK_ENV := P=patches/; _P=../patches/; export P _P
+-include test/.depend
+
+check-% : test/%.test
+	@LANG=C; LC_ALL=C; \
+	export LANG LC_ALL; \
+	$(CHECK_ENV); \
+	cd $(<D); \
+	./run -q $(<F)
diff --git a/meta/recipes-devtools/quilt/quilt/run-ptest b/meta/recipes-devtools/quilt/quilt/run-ptest
new file mode 100755
index 0000000..1ea0dae
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+ln -sf /bin/ed /usr/bin/ed
+for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? == 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
+rm -f /usr/bin/ed



More information about the Openembedded-commits mailing list