Skip to content

Commit bbc574f

Browse files
committed
Testing.
The actual testcases are TODO
1 parent baf13c2 commit bbc574f

File tree

5 files changed

+33
-11
lines changed

5 files changed

+33
-11
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ else
1111
@exit 1
1212
endif
1313

14-
test:
14+
pytest:
1515
sudo tests/test.sh
16+
17+
.PHONY: modload
18+

tests/conftest.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/python3
2+
3+
# TODO

tests/test.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
set -uxe
4+
chip="gpio-mockup-A"
5+
cur="$(pwd)"
6+
7+
rmmod gpio-mockup >/dev/null 2>&1 || true
8+
if lsmod | grep -sq gpio-mockup ; then
9+
echo "Could not remove the gpio-mockup module. Exiting." >&2
10+
exit 1
11+
fi
12+
modprobe gpio-mockup gpio_mockup_ranges=-1,8
13+
cd /sys/class/gpio/
14+
for d in gpiochip* ; do
15+
if test "$(cat $d/label)" = "$chip" ; then
16+
D=$d
17+
break
18+
fi
19+
done
20+
E="/sys/kernel/debug/gpio-mockup-event/$chip"
21+
H="$(hostname | sed -e 's/\..*//')"
22+
cd "$cur"
23+
24+
export PYTHONPATH=.:../asyncgpio
25+
26+
python3 tests/run.py $chip

tests/test_example.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)