mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Runs DS enabled loop in process (#785)
Solves mutex issues, and other issues with the existing teststand software. And simplifies the unit test structure.
This commit is contained in:
committed by
Peter Johnson
parent
26a36779a6
commit
fa0b4428e9
@@ -14,11 +14,13 @@
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
#include "Timer.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "mockds/MockDS.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
class TestEnvironment : public testing::Environment {
|
||||
bool m_alreadySetUp = false;
|
||||
MockDS m_mockDS;
|
||||
|
||||
public:
|
||||
void SetUp() override {
|
||||
@@ -32,6 +34,8 @@ class TestEnvironment : public testing::Environment {
|
||||
std::exit(-1);
|
||||
}
|
||||
|
||||
m_mockDS.start();
|
||||
|
||||
/* This sets up the network communications library to enable the driver
|
||||
station. After starting network coms, it will loop until the driver
|
||||
station returns that the robot is enabled, to ensure that tests
|
||||
@@ -46,7 +50,7 @@ class TestEnvironment : public testing::Environment {
|
||||
}
|
||||
}
|
||||
|
||||
void TearDown() override {}
|
||||
void TearDown() override { m_mockDS.stop(); }
|
||||
};
|
||||
|
||||
testing::Environment* const environment =
|
||||
|
||||
Reference in New Issue
Block a user