forked from robotpy/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
executable file
·83 lines (72 loc) · 1.59 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash -e
cd "$(dirname $0)"
# Keep this list alphabetically sorted
BASE_TESTS="
addressableled
arcade-drive
arm-simulation
commands-v2/armbot
commands-v2/armbotoffboard
commands-v2/drive-distance-offboard
commands-v2/frisbee-bot
commands-v2/gyro-drive-commands
commands-v2/hatchbot
commands-v2/hatchbot-inlined
commands-v2/ramsete
commands-v2/scheduler-event-logging
commands-v2/selectcommand
cscore-intermediate-vision
cscore-quick-vision
elevator-profiled-pid
elevator-simulation
elevator-trapezoid-profile
game-data
getting-started
gyro
magicbot-simple
mecanum-drive
mecanum-driveXbox
mechanism2d
motor-control
physics/src
physics-4wheel/src
physics-mecanum/src
physics-spi/src
shuffleboard
stateful-autonomous
state-space-flywheel
tank-drive
timed/src
"
IGNORED_TESTS="
commands-v2/romi
physics-camsim/src
"
ALL_TESTS="${BASE_TESTS}"
EVERY_TESTS="${ALL_TESTS} ${IGNORED_TESTS}"
TESTS="${ALL_TESTS}"
TMPD=$(mktemp -d)
trap 'rm -rf "$TMPD"' EXIT
# Ensure that when new samples are added, they are added to the list of things
# to test. Otherwise, exit.
for i in ${EVERY_TESTS}; do
echo ./$i/robot.py
done | sort > $TMPD/a
find . -name robot.py | sort > $TMPD/b
if ! diff -u $TMPD/a $TMPD/b; then
if [ -z "$FORCE_ANYWAYS" ]; then
echo "ERROR: Not every robot.py file is in the list of tests!"
exit 1
fi
fi
for t in ${TESTS}; do
pushd $t > /dev/null
pwd
if ! python3 robot.py test --builtin "${@:2}"; then
EC=$?
echo "Test in $(pwd) failed"
exit 1
fi
popd > /dev/null
done
echo "All tests successful!"