summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest53
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb14
2 files changed, 65 insertions, 2 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest
new file mode 100644
index 0000000..93d2db2
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest
@@ -0,0 +1,53 @@
1#!/bin/bash
2
3# The whole test suite may take up to 40 minutes to run, so setting -t 2400
4# parameter in ptest-runner is necessary to not kill it before completion
5
6cd tests
7export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin
8
9PASS_CNT=0
10FAIL_CNT=0
11SKIP_CNT=0
12FAILED=()
13
14# Start unit tests
15for test_case in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do
16 if ./bpftrace_test --gtest_filter="${test_case}*" > /dev/null 2>&1 ; then
17 echo PASS: Unit test $test_case
18 PASS_CNT=$(($PASS_CNT + 1))
19 else
20 echo FAIL: Unit test $test_case
21 FAIL_CNT=$(($FAIL_CNT + 1))
22 FAILED+=("unit:${test_case}")
23 fi
24done
25
26# Start runtime tests
27for test_case in $(ls runtime); do
28 # Ignore test cases that hang the suite forever (bpftrace v0.16.0)
29 case $test_case in
30 sigint)
31 ;&
32 watchpoint)
33 echo SKIP: Runtime test $test_case
34 SKIP_CNT=$(($SKIP_CNT + 1))
35 continue
36 ;;
37 esac
38 if ./runtime-tests.sh --filter="${test_case}.*" > /dev/null 2>&1 ; then
39 echo PASS: Runtime test $test_case
40 PASS_CNT=$(($PASS_CNT + 1))
41 else
42 echo FAIL: Runtime test $test_case
43 FAIL_CNT=$(($FAIL_CNT + 1))
44 FAILED+=("runtime:${test_case}")
45 fi
46done
47
48echo "#### bpftrace tests summary ####"
49echo "# TOTAL: $(($PASS_CNT + $FAIL_CNT + $SKIP_CNT))"
50echo "# PASS: $PASS_CNT"
51echo "# FAIL: $FAIL_CNT (${FAILED[*]})"
52echo "# SKIP: $SKIP_CNT"
53echo "################################"
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb
index 8767115..4e947fc 100644
--- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb
+++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb
@@ -12,19 +12,29 @@ DEPENDS += "bison-native \
12 libcereal \ 12 libcereal \
13 libbpf \ 13 libbpf \
14 " 14 "
15DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'gtest xxd-native', '', d)}"
15 16
16PV .= "+git${SRCREV}" 17PV .= "+git${SRCREV}"
17RDEPENDS:${PN} += "bash python3 xz" 18RDEPENDS:${PN} += "bash python3 xz"
19RDEPENDS:${PN}-ptest += "bash"
18 20
19SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ 21SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \
20 file://0001-Detect-new-BTF-api-btf_dump__new-btf_dump__new_v0_6_.patch \ 22 file://0001-Detect-new-BTF-api-btf_dump__new-btf_dump__new_v0_6_.patch \
21 file://0001-Fix-segfault-when-btf__type_by_id-returns-NULL.patch \ 23 file://0001-Fix-segfault-when-btf__type_by_id-returns-NULL.patch \
24 file://run-ptest \
22" 25"
23SRCREV = "0a318e53343aa51f811183534916a4be65a1871e" 26SRCREV = "0a318e53343aa51f811183534916a4be65a1871e"
24 27
25S = "${WORKDIR}/git" 28S = "${WORKDIR}/git"
26 29
27inherit cmake 30inherit cmake ptest
31
32do_install_ptest() {
33 install -d ${D}${PTEST_PATH}/tests
34 install -m 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests
35 cp -rf ${B}/tests/runtime* ${D}${PTEST_PATH}/tests
36 cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests
37}
28 38
29def llvm_major_version(d): 39def llvm_major_version(d):
30 pvsplit = d.getVar('LLVMVERSION').split('.') 40 pvsplit = d.getVar('LLVMVERSION').split('.')
@@ -36,9 +46,9 @@ EXTRA_OECMAKE = " \
36 -DCMAKE_ENABLE_EXPORTS=1 \ 46 -DCMAKE_ENABLE_EXPORTS=1 \
37 -DCMAKE_BUILD_TYPE=Release \ 47 -DCMAKE_BUILD_TYPE=Release \
38 -DLLVM_REQUESTED_VERSION=${LLVM_MAJOR_VERSION} \ 48 -DLLVM_REQUESTED_VERSION=${LLVM_MAJOR_VERSION} \
39 -DBUILD_TESTING=OFF \
40 -DENABLE_MAN=OFF \ 49 -DENABLE_MAN=OFF \
41" 50"
51EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DBUILD_TESTING=ON', '-DBUILD_TESTING=OFF', d)}"
42 52
43COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" 53COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux"
44COMPATIBLE_HOST:libc-musl = "null" 54COMPATIBLE_HOST:libc-musl = "null"