OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [testtool/] [win32/] [TestTool.cpp] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
// RunTests.cpp : Defines the class behaviors for the application.
23
//
24
 
25
#include "stdafx.h"
26
 
27
#include "CSHDialog.h"
28
#include "eCosDialog.h"
29
#include "eCosTest.h"
30
#include "FileName.h"
31
#include "TestTool.h"
32
#include "RunTestsSheet.h"
33
#include "Properties.h"
34
 
35
#ifdef _DEBUG
36
#define new DEBUG_NEW
37
#undef THIS_FILE
38
static char THIS_FILE[] = __FILE__;
39
#endif
40
 
41
/////////////////////////////////////////////////////////////////////////////
42
// CRunTestsApp
43
 
44
BEGIN_MESSAGE_MAP(CRunTestsApp, CWinApp)
45
        //{{AFX_MSG_MAP(CRunTestsApp)
46
                // NOTE - the ClassWizard will add and remove mapping macros here.
47
                //    DO NOT EDIT what you see in these blocks of generated code!
48
        //}}AFX_MSG
49
        //ON_COMMAND(ID_HELP, CWinApp::OnHelp)
50
END_MESSAGE_MAP()
51
 
52
/////////////////////////////////////////////////////////////////////////////
53
// CRunTestsApp construction
54
 
55
CRunTestsApp::CRunTestsApp()
56
{
57
        // TODO: add construction code here,
58
        // Place all significant initialization in InitInstance
59
}
60
 
61
/////////////////////////////////////////////////////////////////////////////
62
// The one and only CRunTestsApp object
63
 
64
CRunTestsApp theApp;
65
 
66
/////////////////////////////////////////////////////////////////////////////
67
// CRunTestsApp initialization
68
 
69
BOOL CRunTestsApp::InitInstance()
70
{
71
  CeCosSocket::Init();
72
  CeCosTestPlatform::Load();
73
  CFileName strCSHFile;
74
  ::GetModuleFileName(::GetModuleHandle(NULL),strCSHFile.GetBuffer(1+MAX_PATH),MAX_PATH);
75
  strCSHFile.ReleaseBuffer();
76
  strCSHFile.ReplaceExtension(_T(".chm"));
77
  CCSHDialog::SetCSHFilePath(strCSHFile);
78
 
79
  extern UINT  arTestToolDialogMap[];
80
  CeCosDialog::AddDialogMap(arTestToolDialogMap);
81
 
82
    /*
83
        if (!AfxSocketInit())
84
        {
85
                AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
86
                return FALSE;
87
        }
88
    */
89
        AfxEnableControlContainer();
90
 
91
        // Standard initialization
92
        // If you are not using these features and wish to reduce the size
93
        //  of your final executable, you should remove from the following
94
        //  the specific initialization routines you do not need.
95
 
96
#ifdef _AFXDLL
97
        Enable3dControls();                     // Call this when using MFC in a shared DLL
98
#else
99
        Enable3dControlsStatic();       // Call this when linking to MFC statically
100
#endif
101
    /*
102
        CRunTestsDlg dlg;
103
        m_pMainWnd = &dlg;
104
        int nResponse = dlg.DoModal();
105
        if (nResponse == IDOK)
106
        {
107
                // TODO: Place code here to handle when the dialog is
108
                //  dismissed with OK
109
        }
110
        else if (nResponse == IDCANCEL)
111
        {
112
                // TODO: Place code here to handle when the dialog is
113
                //  dismissed with Cancel
114
        }
115
    */
116
    CRunTestsSheet sheet(_T("Run Tests"), NULL, 0, InitFunc);
117
        m_pMainWnd = &sheet;
118
    //sheet.m_psh.hIcon=LoadIcon(IDR_MAINFRAME);
119
    //sheet.m_psh.dwFlags|=PSH_USEHICON/*|PSH_HASHELP*/;
120
    sheet.DoModal();
121
 
122
    // Since the dialog has been closed, return FALSE so that we exit the
123
        //  application, rather than start the application's message pump.
124
  CeCosSocket::Term();
125
  CeCosTestPlatform::RemoveAllPlatforms();
126
 
127
        return FALSE;
128
}
129
 
130
void CALLBACK CRunTestsApp::InitFunc(CProperties *pProp, bool bSave)
131
{
132
    static bool bFirstTime=true;
133
    if(bSave){
134
        pProp->SaveToRegistry(HKEY_CURRENT_USER,_T("Software\\Red Hat\\eCos\\RunTests"));
135
    } else {
136
        pProp->LoadFromCommandString(GetCommandLine());
137
        pProp->LoadFromRegistry(HKEY_CURRENT_USER,_T("Software\\Red Hat\\eCos\\RunTests"));
138
    }
139
    bFirstTime=false;
140
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.