Changeset 163 for trunk/MFCtooling


Ignore:
Timestamp:
08/15/11 15:34:28 (13 years ago)
Author:
sherbold
Message:
  • optional parameter -p now sets the working directory of the application under test
Location:
trunk/MFCtooling/replay
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MFCtooling/replay/LogParser.cpp

    r159 r163  
    88LogParser::LogParser(_TCHAR* runCommand, unsigned int startupTime, TestResults * results, bool useDefaultDelay) : runCommand(runCommand), startupTime(startupTime), results(results), useDefaultDelay(useDefaultDelay) 
    99{ 
    10          
     10        workingPath = NULL; 
    1111} 
    1212 
     
    4242                ZeroMemory(&si, sizeof(si)); 
    4343 
    44                 //divide runCommand into path to executable and parameters 
    45                 /*wchar_t *pdest = _tcschr(runCommand, ' '); 
    46                 int positionSpace = (int)(pdest - runCommand + 1); 
    47                 _TCHAR *executable = new _TCHAR[512]; 
    48                 for(int i=0; i<positionSpace; i++) executable[i] = runCommand[i]; 
    49                 executable[positionSpace] = '\0';*/ 
    50  
    51                 //CreateProcess(executable, L" c:\\programme\\mahr\\marwin\\commands/pause.dll", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); 
    52                 CreateProcess(NULL, runCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); 
     44                CreateProcess(NULL, runCommand, NULL, NULL, FALSE, 0, NULL, workingPath, &si, &pi); 
     45 
    5346                hProcess = pi.hProcess; 
    5447                CloseHandle(pi.hThread); 
     
    257250        } 
    258251} 
     252 
     253void LogParser::setWorkingPath(TCHAR * workingPath) { 
     254        this->workingPath = workingPath; 
     255} 
  • trunk/MFCtooling/replay/LogParser.h

    r142 r163  
    2424 
    2525        _TCHAR * runCommand; 
     26        _TCHAR * workingPath; 
    2627        unsigned int startupTime; 
    2728        HANDLE hProcess; 
     
    6364 
    6465        int getDefaultMsgDelay(); 
     66 
     67        void setWorkingPath(TCHAR * workingPath); 
    6568}; 
  • trunk/MFCtooling/replay/replay.cpp

    r161 r163  
    5050int _tmain(int argc, _TCHAR* argv[]) 
    5151{ 
     52        if( argc < 3 ) { 
     53                return -1; 
     54        } 
     55 
    5256        int optchar; 
    5357        const char * optarg; 
    54  
    5558        // set default values 
    5659        TCHAR * resultfile = NULL; 
     
    122125                std::wcout << L"replaying sessions in " << argv[1] << std::endl; 
    123126                LogParser * parser = new LogParser(appUnderTest, startdelay, &results, (bool) msgdelay); 
     127                parser->setWorkingPath(workingPath); 
    124128                pXMLReader->putContentHandler(parser); 
    125129                hr = pXMLReader->parseURL(replayfile); 
Note: See TracChangeset for help on using the changeset viewer.