grpc
third_party
cares
cares
test
ares-test-main.cc
Go to the documentation of this file.
1
#include <signal.h>
2
#include <stdlib.h>
3
4
#include "
ares-test.h
"
5
6
int
main
(
int
argc,
char
* argv[]) {
7
std::vector<char*> gtest_argv = {argv[0]};
8
for
(
int
ii = 1; ii < argc; ii++) {
9
if
(strcmp(argv[ii],
"-v"
) == 0) {
10
ares::test::verbose
=
true
;
11
}
else
if
((strcmp(argv[ii],
"-p"
) == 0) && (ii + 1 < argc)) {
12
ii++;
13
ares::test::mock_port
= atoi(argv[ii]);
14
}
else
if
(strcmp(argv[ii],
"-4"
) == 0) {
15
ares::test::families
=
ares::test::ipv4_family
;
16
ares::test::families_modes
=
ares::test::ipv4_family_both_modes
;
17
}
else
if
(strcmp(argv[ii],
"-6"
) == 0) {
18
ares::test::families
=
ares::test::ipv6_family
;
19
ares::test::families_modes
=
ares::test::ipv6_family_both_modes
;
20
}
else
{
21
gtest_argv.push_back(argv[ii]);
22
}
23
}
24
int
gtest_argc = gtest_argv.size();
25
gtest_argv.push_back(
nullptr
);
26
::testing::InitGoogleTest
(>est_argc, gtest_argv.data());
27
28
#ifdef WIN32
29
WORD wVersionRequested = MAKEWORD(2, 2);
30
WSADATA wsaData;
31
WSAStartup(wVersionRequested, &wsaData);
32
#else
33
signal
(SIGPIPE, SIG_IGN);
34
#endif
35
36
int
rc =
RUN_ALL_TESTS
();
37
38
#ifdef WIN32
39
WSACleanup();
40
#endif
41
42
return
rc;
43
}
ares::test::ipv6_family
const std::vector< int > ipv6_family
Definition:
ares-test.cc:40
main
int main(int argc, char *argv[])
Definition:
ares-test-main.cc:6
ares::test::families
std::vector< int > families
Definition:
ares-test.cc:58
ares::test::mock_port
int mock_port
Definition:
ares-test.cc:36
signal
static void signal(notification *n)
Definition:
alts_tsi_handshaker_test.cc:107
ares::test::verbose
bool verbose
Definition:
ares-test.cc:34
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition:
bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
ares-test.h
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:6106
ares::test::families_modes
std::vector< std::pair< int, bool > > families_modes
Definition:
ares-test.cc:59
ares::test::ipv4_family
const std::vector< int > ipv4_family
Definition:
ares-test.cc:39
ares::test::ipv4_family_both_modes
const std::vector< std::pair< int, bool > > ipv4_family_both_modes
Definition:
ares-test.cc:48
ares::test::ipv6_family_both_modes
const std::vector< std::pair< int, bool > > ipv6_family_both_modes
Definition:
ares-test.cc:52
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:42