diff options
Diffstat (limited to 'meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest')
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest new file mode 100644 index 0000000000..29ec0d1027 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest @@ -0,0 +1,24 @@ +#!/bin/sh + +testbins="gpiod-test gpio-tools-test.bash gpiod-cxx-test" + +ptestdir=$(dirname "$(readlink -f "$0")") +cd $ptestdir/tests + +# libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to +# make sure configfs is mounted before running any tests. +modprobe configfs +mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config + +for testbin in $testbins; do + if test -e ./$testbin; then + ./$testbin > ./$testbin.out 2>&1 + if [ $? -ne 0 ]; then + echo "FAIL: $testbin" + else + echo "PASS: $testbin" + fi + else + echo "SKIP: $testbin" + fi +done |