diff options
author | Anders Wallin <wallinux@gmail.com> | 2020-02-20 06:23:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-21 09:39:00 +0000 |
commit | e663d093150926f6b46bb0682cf918fe4d9c460e (patch) | |
tree | d5fd48aa1ff0c1429366c9a93f3bd3de18a9e8a6 /meta/recipes-kernel | |
parent | 791e0f5d1c645909793db608c76bb730af1fcf78 (diff) | |
download | poky-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>
Diffstat (limited to 'meta/recipes-kernel')
-rwxr-xr-x | meta/recipes-kernel/lttng/babeltrace/run-ptest | 9 | ||||
-rw-r--r-- | meta/recipes-kernel/lttng/babeltrace_1.5.8.bb | 82 |
2 files changed, 89 insertions, 2 deletions
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. | ||
7 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD" | ||
8 | |||
9 | 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" | |||
7 | 7 | ||
8 | DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" | 8 | DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" |
9 | 9 | ||
10 | SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5" | 10 | SRC_URI = "git://git.linuxfoundation.org/diamon/babeltrace.git;branch=stable-1.5 \ |
11 | file://run-ptest \ | ||
12 | " | ||
11 | SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c" | 13 | SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c" |
12 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)$" | 14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)$" |
13 | 15 | ||
14 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
15 | 17 | ||
16 | inherit autotools pkgconfig | 18 | inherit autotools pkgconfig ptest |
17 | 19 | ||
18 | EXTRA_OECONF = "--disable-debug-info" | 20 | EXTRA_OECONF = "--disable-debug-info" |
19 | 21 | ||
20 | ASNEEDED = "" | 22 | ASNEEDED = "" |
23 | |||
24 | RDEPENDS_${PN}-ptest += "bash gawk" | ||
25 | |||
26 | addtask do_patch_ptest_path after do_patch before do_configure | ||
27 | do_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 | |||
44 | do_compile_ptest () { | ||
45 | make -C tests all | ||
46 | } | ||
47 | |||
48 | do_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 | } | ||