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

« back to all changes in this revision

Viewing changes to lib/cppunit-1.10.0/examples/msvc6/CppUnitTestApp/CppUnitTestApp.cpp

  • 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
// CppUnitTestApp.cpp : Defines the class behaviors for the application.
 
2
//
 
3
 
 
4
#include "stdafx.h"
 
5
#include "CppUnitTestApp.h"
 
6
#include "CppUnitTestAppDlg.h"
 
7
#include <cppunit/ui/mfc/TestRunner.h>
 
8
#include <cppunit/extensions/TestFactoryRegistry.h>
 
9
 
 
10
#ifdef _DEBUG
 
11
#define new DEBUG_NEW
 
12
#undef THIS_FILE
 
13
static char THIS_FILE[] = __FILE__;
 
14
#endif
 
15
 
 
16
/////////////////////////////////////////////////////////////////////////////
 
17
// CppUnitTestApp
 
18
 
 
19
BEGIN_MESSAGE_MAP(CppUnitTestApp, CWinApp)
 
20
        //{{AFX_MSG_MAP(CppUnitTestApp)
 
21
                // NOTE - the ClassWizard will add and remove mapping macros here.
 
22
                //    DO NOT EDIT what you see in these blocks of generated code!
 
23
        //}}AFX_MSG
 
24
        ON_COMMAND(ID_HELP, CWinApp::OnHelp)
 
25
END_MESSAGE_MAP()
 
26
 
 
27
/////////////////////////////////////////////////////////////////////////////
 
28
// CppUnitTestApp construction
 
29
 
 
30
CppUnitTestApp::CppUnitTestApp()
 
31
{
 
32
        // TODO: add construction code here,
 
33
        // Place all significant initialization in InitInstance
 
34
}
 
35
 
 
36
/////////////////////////////////////////////////////////////////////////////
 
37
// The one and only CppUnitTestApp object
 
38
 
 
39
CppUnitTestApp theApp;
 
40
 
 
41
/////////////////////////////////////////////////////////////////////////////
 
42
// CppUnitTestApp initialization
 
43
 
 
44
BOOL 
 
45
CppUnitTestApp::InitInstance()
 
46
{
 
47
        AfxEnableControlContainer();
 
48
 
 
49
        // Standard initialization
 
50
        // If you are not using these features and wish to reduce the size
 
51
        //  of your final executable, you should remove from the following
 
52
        //  the specific initialization routines you do not need.
 
53
 
 
54
#ifdef _AFXDLL
 
55
# if _MSC_VER < 1300   // vc6
 
56
        Enable3dControls();                     // Call this when using MFC in a shared DLL
 
57
# endif
 
58
#else
 
59
        Enable3dControlsStatic();       // Call this when linking to MFC statically
 
60
#endif
 
61
 
 
62
  SetRegistryKey(_T("Local AppWizard-Generated Applications"));
 
63
 
 
64
  RunTests();        
 
65
 
 
66
  
 
67
  // Since the dialog has been closed, return FALSE so that we exit the
 
68
        //  application, rather than start the application's message pump.
 
69
        return FALSE;
 
70
}
 
71
 
 
72
 
 
73
void 
 
74
CppUnitTestApp::RunTests()
 
75
{
 
76
  CPPUNIT_NS::MfcUi::TestRunner runner;
 
77
 
 
78
  runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
 
79
 
 
80
  runner.run();
 
81
}