-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.sh
executable file
·74 lines (64 loc) · 1.41 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
#!/bin/bash -e
cd "$(dirname $0)"
# Keep this list alphabetically sorted
BASE_TESTS="
autonomous-navX-neo-with-spark
digitalinput
drive/arcade-drive
drive/cheezy-drive
drive/combined-drive
drive/drivetrain-navX
drive/tank-drive
encoder
max-neo-encoder
navX
neo-motor
pneumatics
shuffleboard
smartdashboard/combobox
smartdashboard
uart-usb-arduino
"
IGNORED_TESTS="
2023-photonvision
2023-base-code/version1
2023-base-code/version2
2023-base-code/version3-offseason
button-binding
autonomous-forward-two-meters/version1
autonomous-forward-two-meters/version2
autonomous-forward-two-meters/version3
autonomous-forward-two-meters/version4
autonomous-forward-two-meters/version5
pid
networktables
"
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!"