[wpilibc] Clean up integration tests (#3400)

The command and shuffleboard integration tests were removed because
their unit tests counterparts already provide adequate coverage. Java
already removed these.
This commit is contained in:
Tyler Veness
2021-05-31 10:21:34 -07:00
committed by GitHub
parent 4f7a4464df
commit 93523d572e
38 changed files with 662 additions and 2232 deletions

View File

@@ -9,48 +9,48 @@
class TestBench {
public:
/* Analog input channels */
static const uint32_t kCameraGyroChannel = 0;
static const uint32_t kFakeCompressorChannel = 1;
static const uint32_t kFakeAnalogOutputChannel = 2;
static constexpr uint32_t kCameraGyroChannel = 0;
static constexpr uint32_t kFakeCompressorChannel = 1;
static constexpr uint32_t kFakeAnalogOutputChannel = 2;
/* Analog output channels */
static const uint32_t kAnalogOutputChannel = 0;
static constexpr uint32_t kAnalogOutputChannel = 0;
/* DIO channels */
static const uint32_t kTalonEncoderChannelA = 0;
static const uint32_t kTalonEncoderChannelB = 1;
static const uint32_t kVictorEncoderChannelA = 2;
static const uint32_t kVictorEncoderChannelB = 3;
static const uint32_t kJaguarEncoderChannelA = 4;
static const uint32_t kJaguarEncoderChannelB = 5;
static const uint32_t kLoop1OutputChannel = 6;
static const uint32_t kLoop1InputChannel = 7;
static const uint32_t kLoop2OutputChannel = 8;
static const uint32_t kLoop2InputChannel = 9;
static constexpr uint32_t kTalonEncoderChannelA = 0;
static constexpr uint32_t kTalonEncoderChannelB = 1;
static constexpr uint32_t kVictorEncoderChannelA = 2;
static constexpr uint32_t kVictorEncoderChannelB = 3;
static constexpr uint32_t kJaguarEncoderChannelA = 4;
static constexpr uint32_t kJaguarEncoderChannelB = 5;
static constexpr uint32_t kLoop1OutputChannel = 6;
static constexpr uint32_t kLoop1InputChannel = 7;
static constexpr uint32_t kLoop2OutputChannel = 8;
static constexpr uint32_t kLoop2InputChannel = 9;
/* PWM channels */
static const uint32_t kVictorChannel = 1;
static const uint32_t kJaguarChannel = 2;
static const uint32_t kCameraPanChannel = 8;
static const uint32_t kCameraTiltChannel = 9;
static constexpr uint32_t kVictorChannel = 1;
static constexpr uint32_t kJaguarChannel = 2;
static constexpr uint32_t kCameraPanChannel = 8;
static constexpr uint32_t kCameraTiltChannel = 9;
/* MXP digital channels */
static const uint32_t kTalonChannel = 10;
static const uint32_t kFakePressureSwitchChannel = 11;
static const uint32_t kFakeSolenoid1Channel = 12;
static const uint32_t kFakeSolenoid2Channel = 13;
static const uint32_t kFakeRelayForward = 18;
static const uint32_t kFakeRelayReverse = 19;
static constexpr uint32_t kTalonChannel = 10;
static constexpr uint32_t kFakePressureSwitchChannel = 11;
static constexpr uint32_t kFakeSolenoid1Channel = 12;
static constexpr uint32_t kFakeSolenoid2Channel = 13;
static constexpr uint32_t kFakeRelayForward = 18;
static constexpr uint32_t kFakeRelayReverse = 19;
/* Relay channels */
static const uint32_t kRelayChannel = 0;
static constexpr uint32_t kRelayChannel = 0;
/* PDP channels */
static const uint32_t kJaguarPDPChannel = 6;
static const uint32_t kVictorPDPChannel = 8;
static const uint32_t kTalonPDPChannel = 10;
static constexpr uint32_t kJaguarPDPChannel = 6;
static constexpr uint32_t kVictorPDPChannel = 8;
static constexpr uint32_t kTalonPDPChannel = 10;
/* PCM channels */
static const int32_t kSolenoidChannel1 = 0;
static const int32_t kSolenoidChannel2 = 1;
static constexpr int32_t kSolenoidChannel1 = 0;
static constexpr int32_t kSolenoidChannel2 = 1;
};

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include "frc/commands/Command.h"
namespace frc {
class MockCommand : public Command {
public:
explicit MockCommand(Subsystem*);
MockCommand();
int32_t GetInitializeCount() { return m_initializeCount; }
bool HasInitialized();
int32_t GetExecuteCount() { return m_executeCount; }
int32_t GetIsFinishedCount() { return m_isFinishedCount; }
bool IsHasFinished() { return m_hasFinished; }
void SetHasFinished(bool hasFinished) { m_hasFinished = hasFinished; }
int32_t GetEndCount() { return m_endCount; }
bool HasEnd();
int32_t GetInterruptedCount() { return m_interruptedCount; }
bool HasInterrupted();
void ResetCounters();
protected:
void Initialize() override;
void Execute() override;
bool IsFinished() override;
void End() override;
void Interrupted() override;
private:
int32_t m_initializeCount;
int32_t m_executeCount;
int32_t m_isFinishedCount;
bool m_hasFinished;
int32_t m_endCount;
int32_t m_interruptedCount;
};
} // namespace frc

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include "command/MockCommand.h"
#include "frc/commands/ConditionalCommand.h"
namespace frc {
class MockConditionalCommand : public ConditionalCommand {
public:
MockConditionalCommand(MockCommand* onTrue, MockCommand* onFalse);
void SetCondition(bool condition);
int32_t GetInitializeCount() { return m_initializeCount; }
bool HasInitialized();
int32_t GetExecuteCount() { return m_executeCount; }
int32_t GetIsFinishedCount() { return m_isFinishedCount; }
int32_t GetEndCount() { return m_endCount; }
bool HasEnd();
int32_t GetInterruptedCount() { return m_interruptedCount; }
bool HasInterrupted();
void ResetCounters();
protected:
bool Condition() override;
void Initialize() override;
void Execute() override;
bool IsFinished() override;
void End() override;
void Interrupted() override;
private:
bool m_condition = false;
int32_t m_initializeCount;
int32_t m_executeCount;
int32_t m_isFinishedCount;
int32_t m_endCount;
int32_t m_interruptedCount;
};
} // namespace frc

View File

@@ -1,24 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <wpi/StringRef.h>
#include "frc/smartdashboard/Sendable.h"
#include "frc/smartdashboard/SendableBuilder.h"
namespace frc {
/**
* A mock sendable that marks itself as an actuator.
*/
class MockActuatorSendable : public Sendable {
public:
explicit MockActuatorSendable(wpi::StringRef name);
void InitSendable(SendableBuilder& builder) override;
};
} // namespace frc