kmod: Add ptest
authorTudor Florea <tudor.florea@enea.com>
Fri, 19 Jul 2013 17:31:34 +0000 (19:31 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 24 Jul 2013 10:35:35 +0000 (11:35 +0100)
Install kmod test suite and run it as ptest.

(From OE-Core rev: 152c973227e41b7736457b7f8c40849cc71b45ca)

Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/kmod/kmod.inc
meta/recipes-kernel/kmod/kmod/ptest.patch [new file with mode: 0644]
meta/recipes-kernel/kmod/kmod/run-ptest [new file with mode: 0755]
meta/recipes-kernel/kmod/kmod_git.bb

index 3cd963f..a780b6c 100644 (file)
@@ -15,11 +15,13 @@ DEPENDS += "pkgconfig-native"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
                     file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
                    "
-inherit autotools gtk-doc
+inherit autotools gtk-doc ptest
 
 SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
            file://depmod-search.conf \
            file://0001-man-disable-man-page-generation-because-we-don-t-hav.patch \
+           file://run-ptest \
+           file://ptest.patch \
           "
 
 SRCREV = "62081c0f68905b22f375156d4532fd37fa5c8d33"
diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch
new file mode 100644 (file)
index 0000000..839d2a6
--- /dev/null
@@ -0,0 +1,25 @@
+Add 'install-ptest' rule.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am      2013-07-12 17:11:05.278331557 +0200
++++ b/Makefile.am      2013-07-12 17:14:27.033788016 +0200
+@@ -204,6 +204,16 @@
+ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
++install-ptest:
++      @$(MKDIR_P) $(DESTDIR)/testsuite
++      @for file in $(TESTSUITE); do \
++              install $$file $(DESTDIR)/testsuite; \
++      done;
++      @cp Makefile $(DESTDIR)
++      @sed -i 's/^Makefile/_Makefile/'  ${DESTDIR}/Makefile
++      @tar -czf $(DESTDIR)/tools.tgz $(noinst_SCRIPTS) $(noinst_PROGRAMS)
++      @tar -C testsuite -czf $(DESTDIR)/testsuite.tgz rootfs-pristine .libs
++
+ # ------------------------------------------------------------------------------
+ # custom release helpers
+ # ------------------------------------------------------------------------------
diff --git a/meta/recipes-kernel/kmod/kmod/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest
new file mode 100755 (executable)
index 0000000..fac24fd
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+tar -xzf tools.tgz
+tar -C testsuite -xzf testsuite.tgz
+make rootfs
+make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL
index 6afaca6..f92ff72 100644 (file)
@@ -37,6 +37,15 @@ do_install_append () {
         install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
 }
 
+do_compile_prepend() {
+            sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
+}
+
+do_compile_ptest () {
+        oe_runmake buildtest-TESTS
+        oe_runmake rootfs
+}
+
 inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "60"