2018-06-14 14:04:42 +00:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2020-06-08 13:26:53 +00:00
|
|
|
#include <util/logging/logger.hpp>
|
|
|
|
|
2018-11-18 02:22:52 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <winsock2.h>
|
|
|
|
int
|
|
|
|
startWinsock()
|
|
|
|
{
|
|
|
|
WSADATA wsockd;
|
|
|
|
int err;
|
|
|
|
err = ::WSAStartup(MAKEWORD(2, 2), &wsockd);
|
2020-06-08 13:26:53 +00:00
|
|
|
if (err)
|
2018-11-18 02:22:52 +00:00
|
|
|
{
|
|
|
|
perror("Failed to start Windows Sockets");
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-06-14 14:04:42 +00:00
|
|
|
int
|
|
|
|
main(int argc, char** argv)
|
|
|
|
{
|
2020-06-08 13:26:53 +00:00
|
|
|
llarp::LogSilencer shutup;
|
2018-11-18 02:22:52 +00:00
|
|
|
#ifdef _WIN32
|
2020-06-08 13:26:53 +00:00
|
|
|
if (startWinsock())
|
2018-11-18 02:22:52 +00:00
|
|
|
return -1;
|
|
|
|
#endif
|
2019-03-03 15:01:05 +00:00
|
|
|
|
2018-06-14 14:04:42 +00:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
2018-11-18 02:22:52 +00:00
|
|
|
int r = RUN_ALL_TESTS();
|
|
|
|
#ifdef _WIN32
|
|
|
|
WSACleanup();
|
|
|
|
#endif
|
|
|
|
return r;
|
2019-03-03 15:01:05 +00:00
|
|
|
}
|