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 | 43 |
1 files changed, 31 insertions, 12 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 index 29ec0d1027..eae172116f 100644 --- a/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest +++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/run-ptest | |||
@@ -1,24 +1,43 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | testbins="gpiod-test gpio-tools-test.bash gpiod-cxx-test" | ||
4 | |||
5 | ptestdir=$(dirname "$(readlink -f "$0")") | 3 | ptestdir=$(dirname "$(readlink -f "$0")") |
6 | cd $ptestdir/tests | 4 | cd $ptestdir/tests |
7 | 5 | ||
6 | export GPIODBUS_TEST_DAEMON_PATH="$ptestdir/tests/gpio-manager" | ||
7 | export PATH="$ptestdir/tests/:$PATH" | ||
8 | |||
8 | # libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to | 9 | # libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to |
9 | # make sure configfs is mounted before running any tests. | 10 | # make sure configfs is mounted before running any tests. |
10 | modprobe configfs | 11 | modprobe configfs |
11 | mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config | 12 | mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config |
12 | 13 | ||
13 | for testbin in $testbins; do | 14 | # Make sure the daemon is not running during tests. |
14 | if test -e ./$testbin; then | 15 | systemctl stop gpio-manager 2> /dev/null > /dev/null |
15 | ./$testbin > ./$testbin.out 2>&1 | 16 | service gpio-manager stop 2> /dev/null > /dev/null |
16 | if [ $? -ne 0 ]; then | 17 | |
17 | echo "FAIL: $testbin" | 18 | run_one_test() { |
18 | else | 19 | testbin="$1" |
19 | echo "PASS: $testbin" | 20 | |
20 | fi | 21 | ./$testbin > ./$testbin.out 2>&1 |
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: $testbin" | ||
21 | else | 24 | else |
22 | echo "SKIP: $testbin" | 25 | echo "PASS: $testbin" |
23 | fi | 26 | fi |
24 | done | 27 | } |
28 | |||
29 | run_one_test gpiod-test | ||
30 | run_one_test gpio-tools-test.bash | ||
31 | run_one_test gpiod-cxx-test | ||
32 | run_one_test gpiod-glib-test | ||
33 | |||
34 | # Wait for the leftover uevents to be emitted before running DBus tests. | ||
35 | udevadm settle | ||
36 | run_one_test gpiodbus-test | ||
37 | |||
38 | udevadm settle | ||
39 | gpio-manager 2> /dev/null > /dev/null & | ||
40 | GPIO_MANAGER_PID=$! | ||
41 | run_one_test gpiocli-test.bash | ||
42 | kill $GPIO_MANAGER_PID | ||
43 | wait $GPIO_MANAGER_PID | ||