diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
commit | be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /fluent-bit/lib/c-ares-1.19.1/test/ares-test-main.cc | |
parent | Initial commit. (diff) | |
download | netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip |
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/c-ares-1.19.1/test/ares-test-main.cc')
-rw-r--r-- | fluent-bit/lib/c-ares-1.19.1/test/ares-test-main.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fluent-bit/lib/c-ares-1.19.1/test/ares-test-main.cc b/fluent-bit/lib/c-ares-1.19.1/test/ares-test-main.cc new file mode 100644 index 00000000..86ac96a4 --- /dev/null +++ b/fluent-bit/lib/c-ares-1.19.1/test/ares-test-main.cc @@ -0,0 +1,43 @@ +#include <signal.h> +#include <stdlib.h> + +#include "ares-test.h" + +int main(int argc, char* argv[]) { + std::vector<char*> gtest_argv = {argv[0]}; + for (int ii = 1; ii < argc; ii++) { + if (strcmp(argv[ii], "-v") == 0) { + ares::test::verbose = true; + } else if ((strcmp(argv[ii], "-p") == 0) && (ii + 1 < argc)) { + ii++; + ares::test::mock_port = atoi(argv[ii]); + } else if (strcmp(argv[ii], "-4") == 0) { + ares::test::families = ares::test::ipv4_family; + ares::test::families_modes = ares::test::ipv4_family_both_modes; + } else if (strcmp(argv[ii], "-6") == 0) { + ares::test::families = ares::test::ipv6_family; + ares::test::families_modes = ares::test::ipv6_family_both_modes; + } else { + gtest_argv.push_back(argv[ii]); + } + } + int gtest_argc = gtest_argv.size(); + gtest_argv.push_back(nullptr); + ::testing::InitGoogleTest(>est_argc, gtest_argv.data()); + +#ifdef WIN32 + WORD wVersionRequested = MAKEWORD(2, 2); + WSADATA wsaData; + WSAStartup(wVersionRequested, &wsaData); +#else + signal(SIGPIPE, SIG_IGN); +#endif + + int rc = RUN_ALL_TESTS(); + +#ifdef WIN32 + WSACleanup(); +#endif + + return rc; +} |