mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Bail out of the integration tests if enable fails (#792)
A failure is much better then an infinite loop.
This commit is contained in:
committed by
Peter Johnson
parent
65cc85f68d
commit
64bfdc1a69
@@ -43,10 +43,20 @@ class TestEnvironment : public testing::Environment {
|
||||
HAL_ObserveUserProgramStarting();
|
||||
LiveWindow::GetInstance()->SetEnabled(false);
|
||||
|
||||
llvm::outs() << "Waiting for enable\n";
|
||||
llvm::outs() << "Started coms\n";
|
||||
|
||||
int enableCounter = 0;
|
||||
while (!DriverStation::GetInstance().IsEnabled()) {
|
||||
if (enableCounter > 50) {
|
||||
// Robot did not enable properly after 5 seconds.
|
||||
// Force exit
|
||||
llvm::errs() << " Failed to enable. Aborting\n";
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
Wait(0.1);
|
||||
|
||||
llvm::outs() << "Waiting for enable: " << enableCounter++ << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user