summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest')
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest53
1 files changed, 53 insertions, 0 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..aa582e4
--- /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 signals)
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 "################################"