MCPcopy Create free account
hub / github.com/apache/thrift / main

Function main

test/cpp/src/TestClient.cpp:204–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202BOOST_CONSTEXPR_OR_CONST int ERR_UNKNOWN = 64;
203
204int main(int argc, char** argv) {
205 cout.precision(19);
206
207 string testDir = boost::filesystem::system_complete(argv[0]).parent_path().parent_path().parent_path().string();
208 string caPath = testDir + "/keys/CA.pem";
209 string certPath = testDir + "/keys/client.crt";
210 string keyPath = testDir + "/keys/client.key";
211
212#if _WIN32
213 transport::TWinsockSingleton::create();
214#endif
215 string host = "localhost";
216 int port = 9090;
217 int numTests = 1;
218 bool ssl = false;
219 bool zlib = false;
220 string transport_type = "buffered";
221 string protocol_type = "binary";
222 string domain_socket = "";
223 bool abstract_namespace = false;
224 bool noinsane = false;
225
226 int return_code = 0;
227
228 boost::program_options::options_description desc("Allowed options");
229 desc.add_options()
230 ("help,h", "produce help message")
231 ("host",
232 boost::program_options::value<string>(&host)->default_value(host),
233 "Host to connect")
234 ("port",
235 boost::program_options::value<int>(&port)->default_value(port),
236 "Port number to connect")
237 ("domain-socket",
238 boost::program_options::value<string>(&domain_socket)->default_value(domain_socket),
239 "Domain Socket (e.g. /tmp/ThriftTest.thrift), instead of host and port")
240 ("abstract-namespace",
241 "Look for the domain socket in the Abstract Namespace"
242 " (no connection with filesystem pathnames)")
243 ("transport",
244 boost::program_options::value<string>(&transport_type)->default_value(transport_type),
245 "Transport: buffered, framed, http, evhttp, zlib")
246 ("protocol",
247 boost::program_options::value<string>(&protocol_type)->default_value(protocol_type),
248 "Protocol: binary, compact, header, json, multi, multic, multih, multij")
249 ("ssl",
250 "Encrypted Transport using SSL")
251 ("zlib",
252 "Wrap Transport with Zlib")
253 ("testloops,n",
254 boost::program_options::value<int>(&numTests)->default_value(numTests),
255 "Number of Tests")
256 ("noinsane",
257 "Do not run insanity test");
258
259 boost::program_options::variables_map vm;
260 boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
261 boost::program_options::notify(vm);

Callers

nothing calls this directly

Calls 15

nowFunction · 0.85
binary_testFunction · 0.85
emptyMethod · 0.80
goodMethod · 0.80
ciphersMethod · 0.80
loadCertificateMethod · 0.80
loadPrivateKeyMethod · 0.80
authenticateMethod · 0.80
findMethod · 0.80
closeMethod · 0.65
storeFunction · 0.50

Tested by

no test coverage detected