summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest
diff options
context:
space:
mode:
authorMichal Wojcik <michal.wojcik@linaro.org>2022-10-14 15:29:41 +0200
committerKhem Raj <raj.khem@gmail.com>2022-10-17 12:54:08 -0700
commite8fd396155e1f8a5cdb57e7abd0c1eb698635371 (patch)
treee25ec9e9ec1ad839b12f2484b5faa1ede716d8eb /dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest
parentbdbd3741126c1c4144c0c28cf2c0bb1d16d53d9d (diff)
downloadmeta-clang-e8fd396155e1f8a5cdb57e7abd0c1eb698635371.tar.gz
bcc: Add ptest support
Use bcc cc and python test suites and parse their results in ptest form. Running whole suite on qemu may take up to 25 minutes, so running it with "ptest-runner -t 1800 bcc" is recommended. Signed-off-by: Michal Wojcik <michal.wojcik@linaro.org>
Diffstat (limited to 'dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest')
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest42
1 files changed, 42 insertions, 0 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest
new file mode 100644
index 0000000..a27f697
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest
@@ -0,0 +1,42 @@
1#!/bin/sh
2
3cd tests || exit 1
4
5PASS_CNT=0
6FAIL_CNT=0
7FAILED=""
8
9print_test_result() {
10 if [ $? -eq 0 ]; then
11 echo PASS: "$1"
12 PASS_CNT=$((PASS_CNT + 1))
13 else
14 echo FAIL: "$1"
15 FAIL_CNT=$((FAIL_CNT + 1))
16 FAILED="$FAILED $1;"
17 fi
18}
19
20# Run CC tests, set IFS as test names have spaces
21IFS=$(printf '\n\t')
22for test_name in $(./cc/test_libbcc_no_libbpf --list-test-names-only); do
23 ./cc/test_libbcc_no_libbpf "$test_name" > /dev/null 2>&1
24 print_test_result "cc $test_name"
25done
26unset IFS
27
28# Run python tests, skip namespace tests as they currently don't work
29if cmake -DCMAKE_TESTING_ENABLED=ON -DTEST_WRAPPER="$(pwd)/ptest_wrapper.sh" python > /dev/null 2>&1; then
30 for test_name in $(awk -F '[( ]' '/^add_test/ && !/namespace/ {print $2}' CTestTestfile.cmake); do
31 ctest -Q -R "$test_name"
32 print_test_result "python $test_name"
33 done
34else
35 print_test_result "cmake error, couldn't start python tests"
36fi
37
38echo "#### bcc tests summary ####"
39echo "# TOTAL: $((PASS_CNT + FAIL_CNT))"
40echo "# PASS: $PASS_CNT"
41echo "# FAIL: $FAIL_CNT ($FAILED)"
42echo "###########################"