mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Replaced WPILib.h includes in integration tests with the minimum required subheaders to improve compilation times
I ran the benchmark in a tmpfs with an Intel Core i5-2430M. I ran it three times for each combination of build invokation and source tree. First, I tested "make". For master (eb7d55f), I measured an average of 42.751s with a standard deviation of 0.372s. For this commit, I measured an average of 33.394s with a standard deviation of 0.140s. There was a 9.356s, or 22%, improvement with a total error of 1.3%. Second, I tested "make -j4". For master (eb7d55f), I measured an average of 21.723s with a standard deviation of 0.158s. For this commit, I measured an average of 16.823s with a standard deviation of 0.340s. There was a 4.900s, or 23%, improvement with a total error of 2.7%. Change-Id: Idb3adce62ed8ef449360c6583896b6da3565cf58
This commit is contained in:
committed by
Brad Miller (WPI)
parent
e017f93f16
commit
2bf3b6bed4
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <cstdint>
|
||||
|
||||
class TestBench {
|
||||
public:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Commands/Command.h>
|
||||
|
||||
class MockCommand : public Command {
|
||||
private:
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <AnalogInput.h>
|
||||
#include <AnalogOutput.h>
|
||||
#include <AnalogTrigger.h>
|
||||
#include <Counter.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include "AnalogOutput.h"
|
||||
#include <AnalogOutput.h>
|
||||
#include <AnalogPotentiometer.h>
|
||||
#include <Timer.h>
|
||||
#include "TestBench.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <BuiltInAccelerometer.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
static constexpr double kAccelerationTolerance = 0.1;
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <AnalogOutput.h>
|
||||
#include <DigitalOutput.h>
|
||||
#include <CANJaguar.h>
|
||||
#include <Relay.h>
|
||||
#include <Timer.h>
|
||||
#include <WPIErrors.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <CANTalon.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "WPILib.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
#include "HAL/cpp/priority_condition_variable.h"
|
||||
#include "HAL/cpp/priority_mutex.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
namespace wpilib {
|
||||
namespace testing {
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Counter.h>
|
||||
#include <Jaguar.h>
|
||||
#include <Talon.h>
|
||||
#include <Timer.h>
|
||||
#include <Victor.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Counter.h>
|
||||
#include <DigitalInput.h>
|
||||
#include <DigitalOutput.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <AnalogOutput.h>
|
||||
#include <AnalogTrigger.h>
|
||||
#include <DigitalOutput.h>
|
||||
#include <Encoder.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Encoder.h>
|
||||
#include <Jaguar.h>
|
||||
#include <PIDController.h>
|
||||
#include <Talon.h>
|
||||
#include <Timer.h>
|
||||
#include <Victor.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Encoder.h>
|
||||
#include <Jaguar.h>
|
||||
#include <Talon.h>
|
||||
#include <Timer.h>
|
||||
#include <Victor.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "WPILib.h"
|
||||
#include "HAL/cpp/priority_mutex.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include "HAL/cpp/priority_mutex.h"
|
||||
#include <condition_variable>
|
||||
#include <thread>
|
||||
|
||||
namespace wpilib {
|
||||
namespace testing {
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Notifier.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,13 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <AnalogInput.h>
|
||||
#include <Compressor.h>
|
||||
#include <DigitalInput.h>
|
||||
#include <DigitalOutput.h>
|
||||
#include <DoubleSolenoid.h>
|
||||
#include <Solenoid.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Jaguar.h>
|
||||
#include <PowerDistributionPanel.h>
|
||||
#include <Talon.h>
|
||||
#include <Timer.h>
|
||||
#include <Victor.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Preferences.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include <cstdio>
|
||||
#include <fstream>
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <DigitalInput.h>
|
||||
#include <Relay.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
#include "Relay.h"
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <DriverStation.h>
|
||||
#include <LiveWindow/LiveWindow.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
class TestEnvironment : public testing::Environment {
|
||||
bool m_alreadySetUp = false;
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <ADXL345_SPI.h>
|
||||
#include <Gyro.h>
|
||||
#include <Servo.h>
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Timer.h>
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include <Commands/CommandGroup.h>
|
||||
#include <Commands/Scheduler.h>
|
||||
#include <Commands/Subsystem.h>
|
||||
#include <DriverStation.h>
|
||||
#include <RobotState.h>
|
||||
#include <Timer.h>
|
||||
#include "command/MockCommand.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "RobotState.h"
|
||||
#include "DriverStation.h"
|
||||
|
||||
class CommandTest : public testing::Test {
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user