Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | testbins="gpiod-test gpio-tools-test gpiod-cxx-test" |
| 4 | |
| 5 | ptestdir=$(dirname "$(readlink -f "$0")") |
| 6 | cd $ptestdir/tests |
| 7 | |
| 8 | # libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to |
| 9 | # make sure configfs is mounted before running any tests. |
| 10 | modprobe configfs |
| 11 | mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config |
| 12 | |
| 13 | for testbin in $testbins; do |
| 14 | if test -e ./$testbin; then |
| 15 | ./$testbin > ./$testbin.out 2>&1 |
| 16 | if [ $? -ne 0 ]; then |
| 17 | echo "FAIL: $testbin" |
| 18 | else |
| 19 | echo "PASS: $testbin" |
| 20 | fi |
| 21 | else |
| 22 | echo "SKIP: $testbin" |
| 23 | fi |
| 24 | done |