~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to lib/tests/testMain.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <cppunit/BriefTestProgressListener.h>
 
2
#include <cppunit/CompilerOutputter.h>
 
3
#include <cppunit/extensions/TestFactoryRegistry.h>
 
4
#include <cppunit/TestResult.h>
 
5
#include <cppunit/TestResultCollector.h>
 
6
#include <cppunit/TestRunner.h>
 
7
 
 
8
 
 
9
int
 
10
main( int argc, char* argv[] )
 
11
{
 
12
  // Create the event manager and test controller
 
13
  CPPUNIT_NS::TestResult controller;
 
14
 
 
15
  // Add a listener that colllects test result
 
16
  CPPUNIT_NS::TestResultCollector result;
 
17
  controller.addListener( &result );        
 
18
 
 
19
  // Add a listener that print dots as test run.
 
20
  CPPUNIT_NS::BriefTestProgressListener progress;
 
21
  controller.addListener( &progress );      
 
22
 
 
23
  // Add the top suite to the test runner
 
24
  CPPUNIT_NS::TestRunner runner;
 
25
  runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
 
26
  runner.run( controller );
 
27
 
 
28
  // Print test in a compiler compatible format.
 
29
  CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
 
30
  outputter.write(); 
 
31
 
 
32
  return result.wasSuccessful() ? 0 : 1;
 
33
}
 
34
 
 
35