1 #include <gtest/gtest.h>
9 #include <Poco/ConsoleChannel.h>
10 #include <Poco/FileChannel.h>
11 #include <Poco/FormattingChannel.h>
12 #include <Poco/PatternFormatter.h>
13 #include <Poco/Logger.h>
14 #include <Poco/AutoPtr.h>
41 Poco::SharedPtr<SphinxFunctionalObject>
pObj =
nullptr;
51 std::cerr <<
"\nUsage: " << appName <<
" -S <home_dir> -F <data_file_name> -C <index_count> -D <source_test_dir> -I <index_name> -M <need_make_index> -R <need_remove_index>"
52 <<
"\n\n<home_dir> - home dir of cluster node (need for all tests)"
53 <<
"\n<data_file_name> - data file used for create temporary indexes (need for perfomance test)"
54 <<
"\n<index_count> - number of create temporary indexes (need for perfomance test)"
55 <<
"\n<source_test_dir> - source dir content data files (need for stress test)"
56 <<
"\n<index_name> - index name (need for stress test)"
57 <<
"\n<need_make_index> - flag necessary make index (need for stress test)"
58 <<
"\n<need_remove_index> - flag necessary remove index (need for stress test)\n"
65 int main(
int argc,
char** argv)
67 Poco::AutoPtr<Poco::PatternFormatter> pPatternFormatter(
new Poco::PatternFormatter(
"%Y-%m-%d %H:%M:%S.%c %N[%P]:%s:%q:%t"));
68 if (pPatternFormatter)
70 Poco::AutoPtr<Poco::FormattingChannel> pChannel =
new Poco::FormattingChannel(pPatternFormatter);
73 Poco::AutoPtr<Poco::ConsoleChannel> pCons(
new Poco::ConsoleChannel());
74 pChannel->setChannel(pCons);
76 Poco::Logger::root().setChannel(pChannel);
77 Poco::Logger::root().setLevel(
"debug");
93 while((rez = getopt(argc,argv,
"hHs:S:f:F:c:C:d:D:i:I:f:F:m:M:r:R:")) != -1)
124 catch(std::exception& e)
126 std::cerr <<
"Error: " << e.what() <<
std::endl;
130 testing::InitGoogleTest(&argc, argv);
133 testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
137 return RUN_ALL_TESTS();