comparison host/tools/testtool/win32/TestTool.cpp @ 76:435cced73e2f ecos-v1_3_1-release

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