diff options
-rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest | 53 | ||||
-rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb | 14 |
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 | |||
6 | cd tests | ||
7 | export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin | ||
8 | |||
9 | PASS_CNT=0 | ||
10 | FAIL_CNT=0 | ||
11 | SKIP_CNT=0 | ||
12 | FAILED=() | ||
13 | |||
14 | # Start unit tests | ||
15 | for 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 | ||
24 | done | ||
25 | |||
26 | # Start runtime tests | ||
27 | for 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 | ||
46 | done | ||
47 | |||
48 | echo "#### bpftrace tests summary ####" | ||
49 | echo "# TOTAL: $(($PASS_CNT + $FAIL_CNT + $SKIP_CNT))" | ||
50 | echo "# PASS: $PASS_CNT" | ||
51 | echo "# FAIL: $FAIL_CNT (${FAILED[*]})" | ||
52 | echo "# SKIP: $SKIP_CNT" | ||
53 | echo "################################" | ||
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 | " |
15 | DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'gtest xxd-native', '', d)}" | ||
15 | 16 | ||
16 | PV .= "+git${SRCREV}" | 17 | PV .= "+git${SRCREV}" |
17 | RDEPENDS:${PN} += "bash python3 xz" | 18 | RDEPENDS:${PN} += "bash python3 xz" |
19 | RDEPENDS:${PN}-ptest += "bash" | ||
18 | 20 | ||
19 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ | 21 | SRC_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 | " |
23 | SRCREV = "0a318e53343aa51f811183534916a4be65a1871e" | 26 | SRCREV = "0a318e53343aa51f811183534916a4be65a1871e" |
24 | 27 | ||
25 | S = "${WORKDIR}/git" | 28 | S = "${WORKDIR}/git" |
26 | 29 | ||
27 | inherit cmake | 30 | inherit cmake ptest |
31 | |||
32 | do_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 | ||
29 | def llvm_major_version(d): | 39 | def 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 | " |
51 | EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DBUILD_TESTING=ON', '-DBUILD_TESTING=OFF', d)}" | ||
42 | 52 | ||
43 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" | 53 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" |
44 | COMPATIBLE_HOST:libc-musl = "null" | 54 | COMPATIBLE_HOST:libc-musl = "null" |