-
Notifications
You must be signed in to change notification settings - Fork 53
/
run_tests.sh
executable file
·109 lines (98 loc) · 1.88 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash -e
cd "$(dirname $0)"
# Keep this list alphabetically sorted
BASE_TESTS="
AddressableLED
AprilTagsVision
ArcadeDrive
ArcadeDriveXboxController
ArmBot
ArmBotOffboard
ArmSimulation
AxisCamera
CANPDP
DifferentialDriveBot
DigitalCommunication
DriveDistanceOffboard
DutyCycleEncoder
DutyCycleInput
ElevatorProfiledPID
ElevatorSimulation
ElevatorTrapezoidProfile
Encoder
FlywheelBangBangController
FrisbeeBot
GameData
GettingStarted
Gyro
GyroDriveCommands
GyroMecanum
HatchbotInlined
HatchbotTraditional
HidRumble
I2CCommunication
IntermediateVision
MagicbotSimple
MecanumBot
MecanumDrive
MecanumDriveXbox
Mechanism2d
MotorControl
Physics/src
Physics4Wheel/src
PhysicsMecanum/src
PhysicsSPI/src
PotentiometerPID
QuickVision
RamseteController
Relay
RomiReference
SchedulerEventLogging
SelectCommand
ShuffleBoard
Solenoid
StatefulAutonomous
StateSpaceArm
StateSpaceElevator
StateSpaceFlywheel
StateSpaceFlywheelSysId
SwerveBot
SysId
TankDrive
TankDriveXboxController
Timed/src
Ultrasonic
UltrasonicPID
"
IGNORED_TESTS="
RamseteCommand
PhysicsCamSim/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 -m robotpy test --builtin "${@:2}"; then
EC=$?
echo "Test in $(pwd) failed"
exit 1
fi
popd > /dev/null
done
echo "All tests successful!"