当前位置: 首页>>代码示例>>C++>>正文


C++ TestRunner类代码示例

本文整理汇总了C++中TestRunner的典型用法代码示例。如果您正苦于以下问题:C++ TestRunner类的具体用法?C++ TestRunner怎么用?C++ TestRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TestRunner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: run

static bool run(TestRunner& tr)
{
   if(tr.isTestEnabled("fixme"))
   {
      // load and start node
      Node* node = Tester::loadNode(tr, "test-services-customcatalog");
      assertNoException(
         node->start());

      Config cfg = tr.getApp()->getConfig();
      sTestDataDir = cfg["test"]["dataPath"]->getString();

      //config["node"]["modulePath"] = append BPE_MODULES_DIRECTORY;
      //config["bitmunk.catalog.CustomCatalog"]["uploadListings"] = false;

      // run tests
      customCatalogTests(*node, tr);

      // stop and unload node
      node->stop();
      Tester::unloadNode(tr);
   }

   if(tr.isTestEnabled("fixme"))
   {
      // load and start node
      Node* node = Tester::loadNode(tr, "test-services-customcatalog");
      assertNoException(
         node->start());

      Config cfg = tr.getApp()->getConfig();
      sTestDataDir = cfg["test"]["dataPath"]->getString();

      //config["node"]["modulePath"] = BPE_MODULES_DIRECTORY;
      //config["bitmunk.catalog.CustomCatalog"]["uploadListings"] = true;

      // run tests
      interactiveCustomCatalogTests(*node, tr);

      // stop and unload node
      node->stop();
      Tester::unloadNode(tr);
   }

   return true;
};
开发者ID:digitalbazaar,项目名称:bitmunk,代码行数:46,代码来源:test-services-customcatalog.cpp

示例2: run

static bool run(TestRunner& tr)
{
   if(tr.isTestEnabled("pong"))
   {
      runPingTest(tr);
   }
   return true;
}
开发者ID:bsletten,项目名称:monarch,代码行数:8,代码来源:test-pong.cpp

示例3: run

static bool run(TestRunner& tr)
{
   if(tr.isTestEnabled("ws-server"))
   {
      runWebServerTest(tr);
   }
   return true;
}
开发者ID:bsletten,项目名称:monarch,代码行数:8,代码来源:test-ws.cpp

示例4: run

static bool run(TestRunner& tr)
{
   if(tr.isDefaultEnabled())
   {
      runNodeMonitorTest(tr);
   }
   return true;
}
开发者ID:digitalbazaar,项目名称:bitmunk,代码行数:8,代码来源:test-statemonitor.cpp

示例5: run

static bool run(TestRunner& tr)
{
   if(tr.isDefaultEnabled())
   {
      runConfigManagerTest(tr);
   }
   return true;
}
开发者ID:bsletten,项目名称:monarch,代码行数:8,代码来源:test-config.cpp

示例6: run

static bool run(TestRunner& tr)
{
   if(tr.isTestEnabled("fiber-yield"))
   {
      runFiberYieldTest(tr);
   }
   return true;
}
开发者ID:bsletten,项目名称:monarch,代码行数:8,代码来源:test-fiber-yield.cpp

示例7: run

static bool run(TestRunner& tr)
{
   if(tr.isDefaultEnabled())
   {
      runHttpHeaderTest(tr);
      runHttpNormalizePath(tr);
      runCookieTest(tr);
   }
   if(tr.isTestEnabled("http-server"))
   {
      runHttpServerTest(tr);
   }
   if(tr.isTestEnabled("http-pong"))
   {
      runHttpPongTest(tr);
   }
   if(tr.isTestEnabled("http-client-get"))
   {
      runHttpClientGetTest(tr);
   }
   if(tr.isTestEnabled("http-client-redirect-loop"))
   {
      runHttpClientRedirectLoopTest(tr);
   }
   if(tr.isTestEnabled("http-client-post"))
   {
      runHttpClientPostTest(tr);
   }
   if(tr.isTestEnabled("ping"))
   {
      runPingTest(tr);
   }
   return true;
}
开发者ID:bsletten,项目名称:monarch,代码行数:34,代码来源:test-http.cpp

示例8: main

int main (int argc , char** argv)
{
	std::ofstream xml("./cppUnit_output.xml",ios::app);
	
	CppUnit::TestResult controller;
	CppUnit::TestResultCollector result;
	controller.addListener( &result );
	
	TestRunner runner;
	runner.addTest(Manipulation_test::suite());
	runner.run(controller);
	
	CppUnit::XmlOutputter outputter( &result, xml );
	CppUnit::TextOutputter outputter2( &result, std::cerr );
	outputter.write();
	outputter2.write();
	
	return result.wasSuccessful() ? 0 : 1 ;
}
开发者ID:CESNET,项目名称:glite-legacy,代码行数:19,代码来源:manipulation_cu_main.cpp

示例9: main

int main( int, char *argv[] )
{
	using namespace Aeryn;
	int result = -1;

	try
	{
		TestRunner testRunner;

		CommandLineParser commandLineParser( argv );
		result = testRunner.Run( commandLineParser );
	}
	catch( const Exception& e )
	{
		std::cout << e.what() << std::endl;
	}

	return result;
}
开发者ID:davidchappelle,项目名称:aeryn,代码行数:19,代码来源:main.cpp

示例10: run

    virtual void run() {
        TestResultCollector collector;

        // create a test result and add the listeners
        TestResult result;
        result.addListener(&collector);

        // create a test runner
        TestRunner runner;
        MyTest test1;
        MyTest2 test2;
        runner.addTest(&test1);
        runner.addTest(&test2);
        runner.run(result);

        //RTF_TEST_REPORT(Asserter::format("count: %d", collector.failedCount()));
        RTF_TEST_CHECK(collector.testCount() == 2, "Checking tests count");
        RTF_TEST_CHECK(collector.passedCount() == 1, "Checking passed count");
        RTF_TEST_CHECK(collector.failedCount() == 1, "Checking failed count");
    }
开发者ID:robotology,项目名称:robot-testing,代码行数:20,代码来源:MultiTestCases.cpp

示例11: main

/*
 * Run the test suite, return 0 on success, 1 on error.
 */
int main(void) {


	TestResult controller;

	TestResultCollector result;
	controller.addListener(&result);

	BriefTestProgressListener progress;
	controller.addListener(&progress);

	TestRunner runner;
	runner.addTest( TestFactoryRegistry::getRegistry().makeTest() );
	runner.run(controller);

	CompilerOutputter outputter(&result, std::cerr);
	outputter.write();

	return result.wasSuccessful() ? 0 : 1;
}
开发者ID:lmarent,项目名称:network_agents_ver2,代码行数:23,代码来源:test_runner.cpp

示例12: printResult

/*! Runs the named test case.
 *
 * \param testName Name of the test case to run. If an empty is given, then
 *                 all added tests are run. The name can be the name of any
 *                 test in the hierarchy.
 * \param doWait if \c true then the user must press the RETURN key 
 *               before the run() method exit.
 * \param doPrintResult if \c true (default) then the test result are printed
 *                      on the standard output.
 * \param doPrintProgress if \c true (default) then TextTestProgressListener is
 *                        used to show the progress.
 * \return \c true is the test was successful, \c false if the test
 *         failed or was not found.
 */
bool
TextTestRunner::run( std::string testName,
                       bool doWait,
                       bool doPrintResult,
                       bool doPrintProgress )
{
  TextTestProgressListener progress;
  if ( doPrintProgress )
    m_eventManager->addListener( &progress );

  TestRunner *pThis = this;
  pThis->run( *m_eventManager, testName );

  if ( doPrintProgress )
    m_eventManager->removeListener( &progress );

  printResult( doPrintResult );
  wait( doWait );

  return m_result->wasSuccessful();
}
开发者ID:thanhtphung,项目名称:cppware,代码行数:35,代码来源:TextTestRunner.cpp

示例13: contributorGetTest

static void contributorGetTest(Node& node, TestRunner& tr)
{
   tr.group("contributors");

   Messenger* messenger = node.getMessenger();

   tr.test("id");
   {
      Url url("/api/3.0/contributors/1");

      // get contributor
      DynamicObject contributor;
      assertNoException(
         messenger->getFromBitmunk(&url, contributor));

      printf("\nContributor:\n");
      dumpDynamicObject(contributor, false);
   }
   tr.passIfNoException();

   tr.test("owner");
   {
      Url url("/api/3.0/contributors/?owner=900");

      // get contributor
      DynamicObject contributors;
      assertNoException(
         messenger->getFromBitmunk(&url, contributors));

      printf("\nContributors:\n");
      dumpDynamicObject(contributors, false);
   }
   tr.passIfNoException();

   tr.test("media");
   {
      Url url("/api/3.0/contributors/?media=1");

      // get contributor
      DynamicObject contributors;
      assertNoException(
         messenger->getFromBitmunk(&url, contributors));

      printf("\nContributors:\n");
      dumpDynamicObject(contributors, false);
   }
   tr.passIfNoException();

   tr.ungroup();
}
开发者ID:digitalbazaar,项目名称:bitmunk,代码行数:50,代码来源:test-node-services.cpp

示例14: encodeFound

static void encodeFound(TestState& state) {
    if (verbose()) {
        if (state.fPixelWorst.count()) {
            SkTDArray<SortByPixel*> worst;
            for (int index = 0; index < state.fPixelWorst.count(); ++index) {
                *worst.append() = &state.fPixelWorst[index];
            }
            SkTQSort<SortByPixel>(worst.begin(), worst.end() - 1);
            for (int index = 0; index < state.fPixelWorst.count(); ++index) {
                const TestResult& result = *worst[index];
                SkDebugf("%d %s pixelError=%d\n", result.fDirNo, result.fFilename, result.fPixelError);
            }
        }
        if (state.fSlowest.count()) {
            SkTDArray<SortByTime*> slowest;
            for (int index = 0; index < state.fSlowest.count(); ++index) {
                *slowest.append() = &state.fSlowest[index];
            }
            if (slowest.count() > 0) {
                SkTQSort<SortByTime>(slowest.begin(), slowest.end() - 1);
                for (int index = 0; index < slowest.count(); ++index) {
                    const TestResult& result = *slowest[index];
                    SkDebugf("%d %s time=%d\n", result.fDirNo, result.fFilename, result.fTime);
                }
            }
        }
    }
    TestRunner testRunner;
    for (int index = 0; index < state.fPixelWorst.count(); ++index) {
        const TestResult& result = state.fPixelWorst[index];
        SkString filename(result.fFilename);
        if (!filename.endsWith(".skp")) {
            filename.append(".skp");
        }
        *testRunner.fRunnables.append() = new TestRunnableEncode(&testSkpClipEncode, result.fDirNo,
                                                                 filename.c_str(), &testRunner);
    }
    testRunner.render();
}
开发者ID:Crawping,项目名称:chromium_extract,代码行数:39,代码来源:PathOpsSkpClipTest.cpp

示例15: main

int main(int argc,char** argv)
{
	Globals::instance().setDebugMode(true);
	Globals::instance().initLog("ktutester.log");
	TestRunner tr;
	tr.addTest(new UPnPParseDescriptionTest());
	tr.addTest(new UPnPParseResponseTest());
	tr.addTest(new DHTMsgParseTest());
	tr.addTest(new BigIntTest());
	tr.addTest(new RC4Test());
	tr.addTest(new DiffleHellmanTest());
	tr.doAllTests();
	Globals::cleanup();
	return 0;
}
开发者ID:,项目名称:,代码行数:15,代码来源:


注:本文中的TestRunner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。