From 725b059b66c212e76c21e676d60ecacf23719b2a Mon Sep 17 00:00:00 2001 From: Garrett Summerfield Date: Sat, 31 Aug 2024 01:05:18 -0500 Subject: [PATCH] Update GoogleTest harness 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. --- src/test/gtest/cpp/main.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/test/gtest/cpp/main.cpp b/src/test/gtest/cpp/main.cpp index cdb64cc..55a2d05 100644 --- a/src/test/gtest/cpp/main.cpp +++ b/src/test/gtest/cpp/main.cpp @@ -32,12 +32,20 @@ #include "gtest/gtest.h" +#ifdef __linux__ #include - +#elif _WIN32 +#include +#endif int main(int argc, char** argv) { + #ifdef __linux__ rev::usb::SocketCANDriver driver; + #elif _WIN32 + rev::usb::CandleWinUSBDriver driver; + #endif + auto output = driver.GetDevices(); @@ -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(); @@ -66,5 +71,4 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); int ret = RUN_ALL_TESTS(); return ret; - #endif }