From 6e2d8724b023e2b6b55db7845009b4422a53c3b3 Mon Sep 17 00:00:00 2001 From: Gabriel Barbu Date: Thu, 25 Jul 2013 15:28:33 +0200 Subject: strace: Add ptest Install strace test suite and run it as ptest. Signed-off-by: Gabriel Barbu Signed-off-by: Saul Wold --- .../strace/strace-4.8/Makefile-ptest.patch | 28 ++++++++++++++++++++++ meta/recipes-devtools/strace/strace-4.8/run-ptest | 2 ++ meta/recipes-devtools/strace/strace_4.8.bb | 19 +++++++++++++-- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/strace/strace-4.8/Makefile-ptest.patch create mode 100755 meta/recipes-devtools/strace/strace-4.8/run-ptest diff --git a/meta/recipes-devtools/strace/strace-4.8/Makefile-ptest.patch b/meta/recipes-devtools/strace/strace-4.8/Makefile-ptest.patch new file mode 100644 index 0000000000..f5556b23e3 --- /dev/null +++ b/meta/recipes-devtools/strace/strace-4.8/Makefile-ptest.patch @@ -0,0 +1,28 @@ +strace: Add ptest + +Signed-off-by: Gabriel Barbu +Upstream-Status: Pending + +--- old/tests/Makefile.am 2013-07-23 13:44:24.660481381 +0200 ++++ new/tests/Makefile.am 2013-07-23 16:22:42.937654391 +0200 +@@ -9,3 +9,20 @@ + EXTRA_DIST = init.sh $(TESTS) + + CLEANFILES = check.log ++ ++buildtest-TESTS: $(check_PROGRAMS) $(TESTS) ++ ++install-ptest: ++ install $(BUILDDIR)/strace $(DESTDIR) ++ install "$(srcdir)/.."/strace-log-merge $(DESTDIR) ++ install -d $(DESTDIR)/$(TESTDIR) ++ cp $(BUILDDIR)/$(TESTDIR)/Makefile $(DESTDIR)/$(TESTDIR) ++ sed -i -e 's/^Makefile:/_Makefile:/' $(DESTDIR)/$(TESTDIR)/Makefile ++ for file in $(check_PROGRAMS); do \ ++ install $(BUILDDIR)/$(TESTDIR)/$$file $(DESTDIR)/$(TESTDIR); \ ++ done ++ for file in $(EXTRA_DIST); do \ ++ install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \ ++ sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \ ++ done ++ sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/net diff --git a/meta/recipes-devtools/strace/strace-4.8/run-ptest b/meta/recipes-devtools/strace/strace-4.8/run-ptest new file mode 100755 index 0000000000..133cf92d02 --- /dev/null +++ b/meta/recipes-devtools/strace/strace-4.8/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -C tests -k runtest-TESTS diff --git a/meta/recipes-devtools/strace/strace_4.8.bb b/meta/recipes-devtools/strace/strace_4.8.bb index 0f4d2f001e..79a4ad79ab 100644 --- a/meta/recipes-devtools/strace/strace_4.8.bb +++ b/meta/recipes-devtools/strace/strace_4.8.bb @@ -7,11 +7,16 @@ PR = "r0" SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \ file://git-version-gen \ - file://strace-add-configure-options.patch" + file://strace-add-configure-options.patch \ + file://Makefile-ptest.patch \ + file://run-ptest \ + " SRC_URI[md5sum] = "c575ef43829586801f514fd91bfe7575" SRC_URI[sha256sum] = "f492291f07a7c805c07a8395cce1ea054a6401ad414f4cc12185672215e1d7f8" -inherit autotools + +inherit autotools ptest +RDEPENDS_${PN}-ptest += "make" PACKAGECONFIG_class-target ?= "libaio" PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}" @@ -21,6 +26,8 @@ PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" export INCLUDES = "-I. -I./linux" +TESTDIR = "tests" + do_configure_prepend() { cp ${WORKDIR}/git-version-gen ${S} } @@ -30,4 +37,12 @@ do_install_append() { rm ${D}${bindir}/strace-graph } +do_compile_ptest() { + oe_runmake -C ${TESTDIR} buildtest-TESTS +} + +do_install_ptest() { + oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR} +} + BBCLASSEXTEND = "native" -- cgit v1.2.3