Changeset 160 for trunk/MFCtooling/replay
- Timestamp:
- 08/15/11 10:58:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MFCtooling/replay/replay.cpp
r105 r160 10 10 int _tmain(int argc, _TCHAR* argv[]) 11 11 { 12 if (argc< 3)12 if (argc<4) 13 13 { 14 std::wcout << "Usage: " << argv[0] << "<replayfile> <applicationundertest> [<resultfile>] " << std::endl;14 std::wcout << "Usage: " << argv[0] << "<replayfile> <applicationundertest> [<resultfile>] [<useDefaultDelay>] [<waitAfterFinish>]" << std::endl; 15 15 return 0; 16 } 17 TCHAR * replayfile = argv[1]; 18 TCHAR * appUnderTest = argv[2]; 19 TCHAR * resultfile = NULL; 20 bool useDefaultDelay = true; 21 int wait = 1; 22 if( argc>=4 ) { 23 TCHAR * resultfile = argv[3]; 24 } 25 if( argc>=5 ) { 26 useDefaultDelay = (bool) _tstoi(argv[4]); 27 } 28 if( argc>=6 ) { 29 wait = _tstoi(argv[5]); 16 30 } 17 31 … … 29 43 30 44 if( !FAILED(hr) ) { 31 TestResults results( argv[1]);45 TestResults results(replayfile); 32 46 std::wcout << L"replaying sessions in " << argv[1] << std::endl; 33 LogParser * parser = new LogParser(a rgv[2], 5000, &results, true);47 LogParser * parser = new LogParser(appUnderTest, 5000, &results, useDefaultDelay); 34 48 pXMLReader->putContentHandler(parser); 35 hr = pXMLReader->parseURL( argv[1]);49 hr = pXMLReader->parseURL(replayfile); 36 50 pXMLReader->Release(); 37 51 std::wcout << L"================================================" << std::endl; 38 52 std::wcout << L"replay completed" << std::endl; 39 if( argc>=4) {40 results.write( argv[3]);41 std::wcout << L"results written to " << argv[3]<< std::endl;53 if( resultfile!=NULL ) { 54 results.write(resultfile); 55 std::wcout << L"results written to " << resultfile << std::endl; 42 56 } 43 57 } 44 58 45 59 CoUninitialize(); 46 47 std::wcout << L"press enter to exit ..."; 48 getchar(); 60 61 if( wait!=0 ) { 62 std::wcout << L"press enter to exit ..."; 63 getchar(); 64 } 49 65 50 66 return 0;
Note: See TracChangeset
for help on using the changeset viewer.