summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Wallin <wallinux@gmail.com>2020-02-20 06:23:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-21 09:39:00 +0000
commite663d093150926f6b46bb0682cf918fe4d9c460e (patch)
treed5fd48aa1ff0c1429366c9a93f3bd3de18a9e8a6
parent791e0f5d1c645909793db608c76bb730af1fcf78 (diff)
downloadpoky-e663d093150926f6b46bb0682cf918fe4d9c460e.tar.gz
babeltrace: added ptest
(From OE-Core rev: b266a1ac662405e5bab98657c30b1a13cd86d046) Signed-off-by: Anders Wallin <wallinux@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/distro/include/ptest-packagelists.inc1
-rwxr-xr-xmeta/recipes-kernel/lttng/babeltrace/run-ptest9
-rw-r--r--meta/recipes-kernel/lttng/babeltrace_1.5.8.bb82
3 files changed, 90 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 23865ac3e1..752a0882dc 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -61,6 +61,7 @@ PTESTS_FAST = "\
61#" 61#"
62 62
63PTESTS_SLOW = "\ 63PTESTS_SLOW = "\
64 babeltrace-ptest \
64 busybox-ptest \ 65 busybox-ptest \
65 dbus-test-ptest \ 66 dbus-test-ptest \
66 e2fsprogs-ptest \ 67 e2fsprogs-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 @@
1#!/bin/sh
2# use target=recheck if you want to recheck failing tests
3[ "$target" = "" ] && target=check
4
5# Without --ignore-exit, the tap harness causes any FAILs within a
6# test plan to raise ERRORs; this is just noise.
7makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD"
8
9exec 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"
7 7
8DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" 8DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
9 9
10SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5" 10SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5 \
11 file://run-ptest \
12 "
11SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c" 13SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c"
12UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)$" 14UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)$"
13 15
14S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"
15 17
16inherit autotools pkgconfig 18inherit autotools pkgconfig ptest
17 19
18EXTRA_OECONF = "--disable-debug-info" 20EXTRA_OECONF = "--disable-debug-info"
19 21
20ASNEEDED = "" 22ASNEEDED = ""
23
24RDEPENDS_${PN}-ptest += "bash gawk"
25
26addtask do_patch_ptest_path after do_patch before do_configure
27do_patch_ptest_path () {
28 for f in $(grep -l -r abs_top_srcdir ${S}/tests); do
29 sed -i 's:\@abs_top_srcdir\@:${PTEST_PATH}:' ${f}
30 done
31
32 for f in $(grep -l -r abs_top_builddir ${S}/tests); do
33 sed -i 's:\@abs_top_builddir\@:${PTEST_PATH}:' ${f}
34 done
35 for f in $(grep -l -r GREP ${S}/tests); do
36 sed -i 's:\@GREP\@:grep:' ${f}
37 done
38
39 for f in $(grep -l -r SED ${S}/tests); do
40 sed -i 's:\@SED\@:sed:' ${f}
41 done
42}
43
44do_compile_ptest () {
45 make -C tests all
46}
47
48do_install_ptest () {
49 # Copy required files from source directory
50 for f in config/tap-driver.sh config/test-driver; do
51 install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
52 done
53 install -d "$f" "${D}${PTEST_PATH}/tests/ctf-traces/"
54 cp -a ${S}/tests/ctf-traces/* ${D}${PTEST_PATH}/tests/ctf-traces/
55
56 # Copy the tests directory tree and the executables and
57 # Makefiles found within.
58 install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/"
59 for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
60 install -d "${D}${PTEST_PATH}/tests/$d"
61 find "${B}/tests/$d" -maxdepth 1 -executable -type f \
62 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
63 test -r "${B}/tests/$d/Makefile" && \
64 install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
65 find "${B}/tests/$d" -maxdepth 1 -name *.sh \
66 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
67 done
68
69 for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
70 for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
71 cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
72 done
73 done
74
75 install -D ${B}/formats/ctf/metadata/.libs/ctf-parser-test \
76 ${D}${PTEST_PATH}/formats/ctf/metadata/ctf-parser-test
77
78 # Prevent attempts to update Makefiles during test runs, and
79 # silence "Making check in $SUBDIR" messages.
80 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
81 sed -i \
82 -e '/Makefile:/,/^$/d' \
83 -e '/$(check_SCRIPTS)/s/^/#/' \
84 -e '/%: %.in/,/^$/d' \
85 -e '/echo "Making $$target in $$subdir"; \\/d' \
86 -e 's/^srcdir = \(.*\)/srcdir = ./' \
87 -e 's/^builddir = \(.*\)/builddir = ./' \
88 -e 's/^all-am:.*/all-am:/' \
89 {} +
90
91 # Remove path to babeltrace.
92 for f in $(grep -l -r "^BABELTRACE_BIN" ${D}${PTEST_PATH}); do
93 sed -i 's:^BABELTRACE_BIN.*:BABELTRACE_BIN=/usr/bin/babeltrace:' ${f}
94 done
95 for f in $(grep -l -r "^BTBIN" ${D}${PTEST_PATH}); do
96 sed -i 's:^BTBIN.*:BTBIN=/usr/bin/babeltrace:' ${f}
97 done
98}