Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] babeltrace: added ptest
@ 2020-02-18 13:24 Anders Wallin
  2020-02-18 13:32 ` ✗ patchtest: failure for " Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Wallin @ 2020-02-18 13:24 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
 .../recipes-kernel/lttng/babeltrace/run-ptest |  9 ++
 meta/recipes-kernel/lttng/babeltrace_1.5.8.bb | 82 ++++++++++++++++++-
 2 files changed, 89 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-kernel/lttng/babeltrace/run-ptest

diff --git a/meta/recipes-kernel/lttng/babeltrace/run-ptest b/meta/recipes-kernel/lttng/babeltrace/run-ptest
new file mode 100755
index 0000000000..f4b7ce11e2
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace/run-ptest
@@ -0,0 +1,9 @@
+#!/bin/sh
+# use target=recheck if you want to recheck failing tests
+[ "$target" = "" ] && target=check
+
+# Without --ignore-exit, the tap harness causes any FAILs within a
+# test plan to raise ERRORs; this is just noise.
+makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD"
+
+exec make -C tests -k -s $makeargs $target 2>/dev/null
diff --git a/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb b/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb
index b6b7653037..c050dc674d 100644
--- a/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb
+++ b/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb
@@ -7,14 +7,92 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
 
 DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
 
-SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5"
+SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5 \
+	   file://run-ptest \
+	  "
 SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c"
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)$"
 
 S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF = "--disable-debug-info"
 
 ASNEEDED = ""
+
+RDEPENDS_${PN}-ptest += "bash gawk"
+
+addtask do_patch_ptest_path after do_patch before do_configure
+do_patch_ptest_path () {
+    for f in $(grep -l -r abs_top_srcdir ${S}/tests); do
+	sed -i 's:\@abs_top_srcdir\@:${PTEST_PATH}:' ${f}
+    done
+
+    for f in $(grep -l -r abs_top_builddir ${S}/tests); do
+	sed -i 's:\@abs_top_builddir\@:${PTEST_PATH}:' ${f}
+    done
+    for f in $(grep -l -r GREP ${S}/tests); do
+	sed -i 's:\@GREP\@:grep:' ${f}
+    done
+
+    for f in $(grep -l -r SED ${S}/tests); do
+	sed -i 's:\@SED\@:sed:' ${f}
+    done
+}
+
+do_compile_ptest () {
+    make -C tests all
+}
+
+do_install_ptest () {
+    # Copy required files from source directory
+    for f in config/tap-driver.sh config/test-driver; do
+	install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
+    done
+    install -d "$f" "${D}${PTEST_PATH}/tests/ctf-traces/"
+    cp -a ${S}/tests/ctf-traces/* ${D}${PTEST_PATH}/tests/ctf-traces/
+
+    # Copy the tests directory tree and the executables and
+    # Makefiles found within.
+    install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/"
+    for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
+	install -d "${D}${PTEST_PATH}/tests/$d"
+	find "${B}/tests/$d" -maxdepth 1 -executable -type f \
+	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
+	test -r "${B}/tests/$d/Makefile" && \
+	    install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
+	find "${B}/tests/$d" -maxdepth 1 -name *.sh \
+	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
+    done
+
+    for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
+	for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
+	    cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
+	done
+    done
+
+    install -D ${B}/formats/ctf/metadata/.libs/ctf-parser-test \
+	    ${D}${PTEST_PATH}/formats/ctf/metadata/ctf-parser-test
+
+    # Prevent attempts to update Makefiles during test runs, and
+    # silence "Making check in $SUBDIR" messages.
+    find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+	 sed -i \
+	 -e '/Makefile:/,/^$/d' \
+	 -e '/$(check_SCRIPTS)/s/^/#/' \
+	 -e '/%: %.in/,/^$/d' \
+	 -e '/echo "Making $$target in $$subdir"; \\/d' \
+	 -e 's/^srcdir = \(.*\)/srcdir = ./' \
+	 -e 's/^builddir = \(.*\)/builddir = ./' \
+	 -e 's/^all-am:.*/all-am:/' \
+	 {} +
+
+    # Remove path to babeltrace.
+    for f in $(grep -l -r "^BABELTRACE_BIN" ${D}${PTEST_PATH}); do
+	sed -i 's:^BABELTRACE_BIN.*:BABELTRACE_BIN=/usr/bin/babeltrace:' ${f}
+    done
+    for f in $(grep -l -r "^BTBIN" ${D}${PTEST_PATH}); do
+	sed -i 's:^BTBIN.*:BTBIN=/usr/bin/babeltrace:' ${f}
+    done
+}
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* ✗ patchtest: failure for babeltrace: added ptest
  2020-02-18 13:24 [PATCH] babeltrace: added ptest Anders Wallin
@ 2020-02-18 13:32 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2020-02-18 13:32 UTC (permalink / raw)
  To: Anders Wallin; +Cc: openembedded-core

== Series Details ==

Series: babeltrace: added ptest
Revision: 1
URL   : https://patchwork.openembedded.org/series/22726/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at c9b5802bbe)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-18 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-18 13:24 [PATCH] babeltrace: added ptest Anders Wallin
2020-02-18 13:32 ` ✗ patchtest: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox