Skip to content

Commit

Permalink
Update GoogleTest harness
Browse files Browse the repository at this point in the history
The current implementation of the tests were accounting for only Linux platforms for SocketCAN, this has been changed to allow for all currently supported platforms. This also removes conditionals that prevented any GoogleTests from running.
  • Loading branch information
garrettsummerfi3ld committed Aug 31, 2024
1 parent 4b9c79b commit 725b059
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/test/gtest/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,20 @@

#include "gtest/gtest.h"

#ifdef __linux__
#include <rev/Drivers/SocketCAN/SocketCANDriver.h>

#elif _WIN32
#include <rev/Drivers/CandleWinUSB/CandleWinUSBDriver.h>
#endif

int main(int argc, char** argv) {

#ifdef __linux__
rev::usb::SocketCANDriver driver;
#elif _WIN32
rev::usb::CandleWinUSBDriver driver;
#endif


auto output = driver.GetDevices();

Expand All @@ -54,9 +62,6 @@ int main(int argc, char** argv) {

std::cout << "Selected device: " << device->GetName() << std::endl;

return 0;

#if 0
HAL_Initialize(500, 0);
frc::MockDS ds;
ds.start();
Expand All @@ -66,5 +71,4 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
#endif
}

0 comments on commit 725b059

Please sign in to comment.