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-ptest59
1 files changed, 28 insertions, 31 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
index aa582e4..bab3033 100644
--- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest
+++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest
@@ -1,53 +1,50 @@
1#!/bin/bash 1#!/bin/sh
2 2
3# The whole test suite may take up to 40 minutes to run, so setting -t 2400 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 4# parameter in ptest-runner is necessary to not kill it before completion
5 5
6cd tests 6cd tests || exit 1
7export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin 7export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin
8 8
9PASS_CNT=0 9PASS_CNT=0
10FAIL_CNT=0 10FAIL_CNT=0
11SKIP_CNT=0 11SKIP_CNT=0
12FAILED=() 12FAILED=""
13 13
14print_test_result() {
15 if [ $? -eq 0 ]; then
16 echo "PASS: $1"
17 PASS_CNT=$((PASS_CNT + 1))
18 else
19 echo "FAIL: $1"
20 FAIL_CNT=$((FAIL_CNT + 1))
21 FAILED="${FAILED:+$FAILED }$1;"
22 fi
23 }
24
25IFS=$(printf '\n\t')
14# Start unit tests 26# Start unit tests
15for test_case in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do 27for test_name in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do
16 if ./bpftrace_test --gtest_filter="${test_case}*" > /dev/null 2>&1 ; then 28 ./bpftrace_test --gtest_filter="${test_name}*" > /dev/null 2>&1
17 echo PASS: Unit test $test_case 29 print_test_result "unit:$test_name"
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 30done
25 31
26# Start runtime tests 32# Start runtime tests
27for test_case in $(ls runtime); do 33for test_name in $(ls runtime); do
28 # Ignore test cases that hang the suite forever (bpftrace v0.16.0) 34 # Ignore test cases that hang the suite forever (bpftrace v0.16.0)
29 case $test_case in 35 if [ "$test_name" = "signals" ] || [ "$test_name" = "watchpoint" ]; then
30 signals) 36 echo "SKIP: runtime:$test_name"
31 ;& 37 SKIP_CNT=$((SKIP_CNT + 1))
32 watchpoint) 38 continue
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 39 fi
40 python3 runtime/engine/main.py --filter="${test_name}.*" > /dev/null 2>&1
41 print_test_result "runtime:$test_name"
46done 42done
43unset IFS
47 44
48echo "#### bpftrace tests summary ####" 45echo "#### bpftrace tests summary ####"
49echo "# TOTAL: $(($PASS_CNT + $FAIL_CNT + $SKIP_CNT))" 46echo "# TOTAL: $((PASS_CNT + FAIL_CNT + SKIP_CNT))"
50echo "# PASS: $PASS_CNT" 47echo "# PASS: $PASS_CNT"
51echo "# FAIL: $FAIL_CNT (${FAILED[*]})" 48echo "# FAIL: $FAIL_CNT ($FAILED)"
52echo "# SKIP: $SKIP_CNT" 49echo "# SKIP: $SKIP_CNT"
53echo "################################" 50echo "################################"