本文整理汇总了C++中outputter函数的典型用法代码示例。如果您正苦于以下问题:C++ outputter函数的具体用法?C++ outputter怎么用?C++ outputter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outputter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
TestOption& option = TestOption::Instance();
//命令行解析测试
if(!option.init(argc,argv))
{
return -1;
}
//设置过滤器
TestFilter filter;
filter.setCondition(option.getFilterString());
TestRegistry::setTestFilter(&filter);
//设置输出方式
TestResult tr;
TextOutputter outputter(&tr);
outputter.setShowMode(option.isShowAll());
tr.addListener(&outputter);
//设置全局环境
AddGlobalTestEnvironment(new TestEnv);
//设置重复执行的次数
TestRegistry::runAllTests(tr, option.getRepeatTimes());
// //ini文件解析测试
// FileParse::parse("StackTest.ut");
// FileParse::close();
//
// //Executor测试
// TestCmdExecutor::execute("groupname_testname1",STEP_PRETEST,FileParse::getTestCmdArray());
return 0;
}
示例2: main
int main(int argc, char* argv[])
{
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// Add a listener that print dots as test run.
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener( &progress );
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry("All Tests").makeTest() );
runner.run( controller );
// Print test in a text format.
CPPUNIT_NS::TextOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
outputter.write();
// This for XML output
std::ofstream file( "TestResult.xml" );
CPPUNIT_NS::XmlOutputter xml( &result, file );
xml.setStyleSheet( "report.xsl" );
xml.write();
file.close();
return result.wasSuccessful() ? 0 : 1;
}
示例3: main
int
main( int, char ** )
{
// create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// add a listner that collects test results
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// add a listener that prints dots as test run.
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener( &progress );
//CPPUNIT_NS::TextTestProgressListener textprog;
//controller.addListener( &textprog );
// add the top suite to the test runner.
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
runner.run( controller );
// output results in a compiler compatible format
CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
//CPPUNIT_NS::TextOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
//CPPUNIT_NS::XmlOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
示例4: main
int main( int argc, char **argv )
{
argc = 0;
std::cout << "Running " << argv[argc] << std::endl;
// イベントマネージャを作成する
CPPUNIT_NS::TestResult controller;
// テスト結果を収集するオブジェクトを作成する
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// テスト実行時に進行状況を表示するオブジェクトを作成する
//CPPUNIT_NS::BriefTestProgressListener progress;
//controller.addListener( &progress );
// テストランナーにテストを設定する
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry( ).makeTest( ) );
runner.run( controller );
// テスト結果を出力する
CPPUNIT_NS::TextOutputter outputter( &result, std::cout );
outputter.write( );
// テストに成功した場合に 0 を返し,失敗したら 1 を返す
return( result.wasSuccessful( ) ? 0 : 1 );
}
示例5: main
int main(int argc, char** argv)
{
try
{
CPPUNIT_NS::TestResult controller;
CPPUNIT_NS::TestResultCollector result;
controller.addListener(&result);
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener(&progress);
CPPUNIT_NS::TestRunner runner;
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
runner.run(controller);
CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut());
outputter.write();
return result.wasSuccessful() ? 0 : -1;
}
catch(const std::exception& exc)
{
std::cout << exc.what() << std::endl;
}
catch(...)
{
std::cout << "Unknown exception." << std::endl;
}
return -1;
}
示例6: main
int
main( int argc, char* argv[] )
{
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// Add a listener that print dots as test run.
//CPPUNIT_NS::BriefTestProgressListener progress;
//controller.addListener( &progress );
//controller.push
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
runner.run( controller );
// Print test in a compiler compatible format.
CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
示例7: main
int main( int ac, char **av )
{
// イベント・マネージャとテスト・コントローラを生成する
CPPUNIT_NS::TestResult controller;
// テスト結果収集リスナをコントローラにアタッチする
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// 「.」で進行状況を出力するリスナをアタッチする
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener( &progress );
// テスト・ランナーにテスト群を与え、テストする
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
runner.run( controller );
// テスト結果を標準出力に吐き出す
CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
示例8: main
int main(int argc, char *argv[])
{
Logging::Logger::setGlobalLogger(new Logging::GenericLogger("testLogger"));
// initialize the AlarmSystemInterfaceFactory
ACSAlarmSystemInterfaceFactory::init(NULL);
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// Add a listener that print dots as test run.
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener( &progress );
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
runner.run( controller );
// Print test in a compiler compatible format.
std::cout.flush();
CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
outputter.write();
// close the AlarmSystemInterfaceFactory
ACSAlarmSystemInterfaceFactory::done();
return result.wasSuccessful() ? 0 : 1;
}
示例9: DoOutObjectName
extern void DoOutObjectName( cg_sym_handle sym,
void (*outputter)( char *, void * ),
void *data,
import_type kind ) {
/*******************************************************************/
char *dst;
char buffer[TS_MAX_OBJNAME + TRUNC_SYMBOL_HASH_LEN];
unsigned pref_len;
dst = buffer;
switch( kind ) {
case SPECIAL:
pref_len = (sizeof( SPEC_PREFIX )-1);
dst = CopyStr( SPEC_PREFIX, dst );
break;
case DLLIMPORT:
pref_len = (sizeof( DLLIMPORT_PREFIX )-1);
dst = CopyStr( DLLIMPORT_PREFIX, dst );
break;
case PIC_RW:
pref_len = (sizeof( PIC_RW_PREFIX )-1);
dst = CopyStr( PIC_RW_PREFIX, dst );
break;
default:
pref_len = 0;
}
GetExtName( sym, dst, TS_MAX_OBJNAME - 1 - pref_len );
outputter( buffer, data );
}
示例10: main
int main(int argc, char** argv) {
TestTreeBuilder treeBuilder;
setlocale(LC_ALL, ""); /* Use system locale instead of default "C" */
if (argc != 2) {
fprintf(stderr, "Usage: %s regex string\n", argv[0]);
return 1;
}
FILE *f = fopen(argv[1], "r");
fseek(f, 0L, SEEK_END);
size_t length = ftell(f);
fseek(f, 0L, SEEK_SET);
char *buffer = new char[length + 1];
buffer[length] = 0;
fread(buffer, length, 1, f);
fclose(f);
length = RemoveCRs(buffer, length);
{
HTMLParser treeParser;
treeParser.Parse(treeBuilder, buffer,length);
}
HTMLOutputterString outputter(cout);
treeBuilder.AsHTML(outputter);
cout << endl;
return 0;
}
示例11: main
int
main( int argc, char* argv[] )
{
util::CLoggerMgr::Config(util::Log4Cxx);
// Create the event manager and test controller
CPPUNIT_NS::TextTestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// Add a listener that print dots as test run.
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener( &progress );
// Add the top suite to the test runner
//CPPUNIT_NS::TextTestRunner runner;
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
runner.run( controller);
// Print test in a compiler compatible format.
CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
outputter.write();
util::CLoggerMgr::CleanLoggers();
system("pause");
return result.wasSuccessful() ? 0 : 1;
}
示例12: main
int main(int argc, char *argv[])
{
/* input pins to LUT KEY
1 = 0 100000
2 = 1 010000
4 = 2 001000
8 = 3 000100
16 = 4 000010
32 = 5 000001
Lookup table 0-127 (128 symbols) outputs LSB Q and !Q (via assert)
*/
// just for setup:
//outputter();
// debug ^^
Lut lut6;
const unsigned char MAXLUTIN = 252; // 000000** - 111111** inclusive.
const unsigned char MAXLUTOUT = 2; // ******00 - ******10 (so 01 and 10)
unsigned char i = 0;
for (i=0;i<=(MAXLUTIN+MAXLUTOUT);i++) {
if (get_bit_from_char(i, 0) != get_bit_from_char(i,1)) {
lut6.lut=i;
printf("%d\tQ=%d\tQ_PRIME=%d\t",lut6.lut,getQ(lut6.lut),!getQ(lut6.lut));
printf("BINARY: ");
outputter(i);
}
}
return 0;
}
示例13: main
int main()
{
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener(&result);
// Add a listener that print dots as test run.
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener(&progress);
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
runner.run(controller);
// output
CPPUNIT_NS::CompilerOutputter outputter(&result, std::cerr);
outputter.write();
// return status code
return result.wasSuccessful() ? 0 : 1;
}
示例14: main
int main(int argc, char* argv[])
{
std::string testPath = (argc > 1) ? std::string(argv[1]) : std::string("");
CPPUNIT_NS::TestResult controller;
CPPUNIT_NS::TestResultCollector result;
controller.addListener(&result);
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener(&progress);
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest());
try
{
CPPUNIT_NS::stdCOut() << "Running " << testPath;
runner.run(controller, testPath);
CPPUNIT_NS::stdCOut() << "\n";
CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut());
outputter.write();
}
catch( std::invalid_argument& e)
{
CPPUNIT_NS::stdCOut() << "\n" << "ERROR: " << e.what() << "\n";
}
return result.wasSuccessful() ? 0 : 1;
}
示例15: run_multi_cdn_strategy_test_case
int run_multi_cdn_strategy_test_case()
{
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener( &result );
// Add a listener that print dots as test run.
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener( &progress );
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
runner.run( controller );
// Print test in a compiler compatible format.
std::ofstream ofs("c:\\MultiCdnTestResult.txt");
CPPUNIT_NS::CompilerOutputter outputter( &result, ofs );
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}