| 63 | |
| 64 | struct GlobalFixture { |
| 65 | GlobalFixture() { |
| 66 | using namespace boost::unit_test::framework; |
| 67 | for (int i = 0; i < master_test_suite().argc; ++i) { |
| 68 | BOOST_TEST_MESSAGE(boost::format("argv[%1%] = \"%2%\"") % i % master_test_suite().argv[i]); |
| 69 | } |
| 70 | |
| 71 | #ifdef __linux__ |
| 72 | // OpenSSL calls send() without MSG_NOSIGPIPE so writing to a socket that has |
| 73 | // disconnected can cause a SIGPIPE signal... |
| 74 | signal(SIGPIPE, SIG_IGN); |
| 75 | #endif |
| 76 | |
| 77 | TSSLSocketFactory::setManualOpenSSLInitialization(true); |
| 78 | apache::thrift::transport::initializeOpenSSL(); |
| 79 | |
| 80 | keyDir = boost::filesystem::current_path().parent_path().parent_path().parent_path() / "test" / "keys"; |
| 81 | if (!boost::filesystem::exists(certFile("server.crt"))) { |
| 82 | keyDir = boost::filesystem::path(master_test_suite().argv[master_test_suite().argc - 1]); |
| 83 | if (!boost::filesystem::exists(certFile("server.crt"))) { |
| 84 | throw std::invalid_argument("The last argument to this test must be the directory containing the test certificate(s)."); |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | virtual ~GlobalFixture() { |
| 90 | apache::thrift::transport::cleanupOpenSSL(); |
nothing calls this directly
no test coverage detected