9#ifndef SQUID_INCLUDE_UNITTESTMAIN_H
10#define SQUID_INCLUDE_UNITTESTMAIN_H
12#if ENABLE_DEBUG_SECTION
16#include <cppunit/BriefTestProgressListener.h>
17#include <cppunit/TextTestProgressListener.h>
18#include <cppunit/CompilerOutputter.h>
19#include <cppunit/extensions/TestFactoryRegistry.h>
20#include <cppunit/TestResult.h>
21#include <cppunit/TestResultCollector.h>
22#include <cppunit/TestRunner.h>
37 int run(
int argc,
char *argv[]);
46#if ENABLE_DEBUG_SECTION
52 return result ? 0 : 1;
61 CPPUNIT_NS::TestResult controller;
64 CPPUNIT_NS::TestResultCollector result;
65 controller.addListener( &result );
71 CPPUNIT_NS::TextTestProgressListener progress;
72 controller.addListener( &progress );
75 CPPUNIT_NS::TestRunner runner;
76 runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
77 runner.run( controller );
80 CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
83 return result.wasSuccessful();
static int Levels[MAX_DEBUG_SECTIONS]
implements test program's main() function while enabling customization
virtual ~TestProgram()=default
int run(int argc, char *argv[])