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:
Thad House
2017-11-28 19:12:05 -08:00
committed by Peter Johnson
parent 26a36779a6
commit fa0b4428e9
11 changed files with 228 additions and 106 deletions

View File

@@ -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 =