Merge "A few small changes to the C++ ITs"

This commit is contained in:
Brad Miller (WPI)
2014-07-25 08:54:42 -07:00
committed by Gerrit Code Review
5 changed files with 19 additions and 15 deletions

View File

@@ -4,9 +4,10 @@
if [ $(which sshpass) ]
then
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $*
# Send stderr to /dev/null - the only thing printed to it is the login prompt
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram java 2> /dev/null
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin 2> /dev/null
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $* 2> /dev/null
else
ssh admin@10.1.90.2 killall FRCUserProgram
scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin

View File

@@ -57,6 +57,6 @@ public:
/* PDP channels */
static const uint32_t kJaguarPDPChannel = 6;
static const uint32_t kVictorPDPChannel = 10;
static const uint32_t kVictorPDPChannel = 8;
static const uint32_t kTalonPDPChannel = 11;
};

View File

@@ -8,8 +8,7 @@
#include "WPILib.h"
#include "gtest/gtest.h"
static constexpr double accelerationTolerance = 0.1;
static constexpr double kAccelerationTolerance = 0.1;
/**
* There's not much we can automatically test with the on-board accelerometer,
* but checking for gravity is probably good enough to tell that it's working.
@@ -17,7 +16,11 @@ static constexpr double accelerationTolerance = 0.1;
TEST(AccelerometerTest, Accelerometer) {
BuiltInAccelerometer accelerometer;
ASSERT_NEAR(0.0, accelerometer.GetX(), accelerationTolerance);
ASSERT_NEAR(0.0, accelerometer.GetY(), accelerationTolerance);
ASSERT_NEAR(1.0, accelerometer.GetZ(), accelerationTolerance);
/* The testbench sometimes shakes a little from a previous test. Give it
some time. */
Wait(1.0);
ASSERT_NEAR(0.0, accelerometer.GetX(), kAccelerationTolerance);
ASSERT_NEAR(0.0, accelerometer.GetY(), kAccelerationTolerance);
ASSERT_NEAR(1.0, accelerometer.GetZ(), kAccelerationTolerance);
}

View File

@@ -15,23 +15,23 @@ public:
std::cerr << "FATAL ERROR: HAL could not be initialized" << std::endl;
exit(-1);
}
/* 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 will be
able to run on the hardware. */
able to run on the hardware. */
HALNetworkCommunicationObserveUserProgramStarting();
LiveWindow::GetInstance()->SetEnabled(false);
std::cout << "Waiting for enable" << std::endl;
while(!DriverStation::GetInstance()->IsEnabled()) {
Wait(0.1);
std::cout << "Waiting for enable" << std::endl;
}
}
virtual void TearDown() {
}
};
testing::Environment *const environment = testing::AddGlobalTestEnvironment(new TestEnvironment);