Ignore:
Timestamp:
07/05/11 13:04:29 (13 years ago)
Author:
sherbold
Message:

+ added test verdict pass/fail, including error message and the number of the message in the session at which the verdict was set
+ added result file; location is a parameter when calling the application
+ added test arbiter: if the target of a message cannot be determined correctly, the session fails

File:
1 edited

Legend:

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

    r104 r105  
    66#include "WindowFinder.h" 
    77 
    8 LogParser::LogParser(_TCHAR* runCommand, unsigned int startupTime, bool useDefaultDelay) : runCommand(runCommand), startupTime(startupTime), useDefaultDelay(useDefaultDelay) 
     8LogParser::LogParser(_TCHAR* runCommand, unsigned int startupTime, TestResults * results, bool useDefaultDelay) : runCommand(runCommand), startupTime(startupTime), results(results), useDefaultDelay(useDefaultDelay) 
    99{ 
    1010         
     
    2828        std::wstring localName(pwchLocalName); 
    2929        if( localName.compare(L"session")==0 ) { 
    30                 std::wstring sessionId = GetAttributeValue(pAttributes, L"id", L""); 
     30                sessionId = GetAttributeValue(pAttributes, L"id", L""); 
    3131                std::wcout << L"================================================" << std::endl; 
    3232                std::wcout << L"starting session " << sessionId << std::endl; 
     33                result.sessionPass = true; 
     34                result.errorMessage = L""; 
     35                result.msgNumber = 0; 
     36                currentMessage = 0; 
    3337                std::wcout << L"executing " << runCommand << std::endl; 
    3438                PROCESS_INFORMATION pi; 
     
    9094        if( localName.compare(L"session")==0 ) { 
    9195                std::wcout << L"session completed" << std::endl; 
     96                results->addResult(sessionId, result); 
    9297                BOOL retVal = TerminateProcess(hProcess, 0); 
    9398                if( retVal!=0 ) { 
     
    97102        }  
    98103        else if( localName.compare(L"msg")==0 ) { 
     104                currentMessage++; 
    99105                WindowFinder finder; 
    100106                HWND hwnd = finder.find(currentWindow); 
     107                // check if window was found, if not test has failed 
     108                if( result.sessionPass ) { 
     109                        result.sessionPass = false; 
     110                        result.errorMessage = finder.getErrorMessage(); 
     111                        result.msgNumber = currentMessage; 
     112                } 
     113 
    101114                sendMessage(hwnd); 
    102115                deleteWindowData(currentWindow); 
Note: See TracChangeset for help on using the changeset viewer.