source: trunk/MFCtooling/replay/replay.cpp @ 106

Last change on this file since 106 was 105, checked in by sherbold, 13 years ago

+ 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 size: 1.3 KB
RevLine 
[32]1// replay.cpp : Defines the entry point for the console application.
2//
3
4#include "stdafx.h"
5
6#include "LogParser.h"
7#include "SAXContentHandlerImpl.h"
8#include <iostream>
9
10int _tmain(int argc, _TCHAR* argv[])
11{
[104]12        if (argc<3)
[32]13        {
[105]14                std::wcout << "Usage: " << argv[0] << "<replayfile> <applicationundertest> [<resultfile>]" << std::endl;
[32]15                return 0;
16        }
17
18        // initialize COM library for the current thread
19        CoInitialize(NULL);
20        MSXML2::ISAXXMLReader* pXMLReader = NULL;
21
22        // create an instance of the XML reader
23        HRESULT hr = CoCreateInstance(
24                __uuidof(MSXML2::SAXXMLReader),
25                NULL,
26                CLSCTX_ALL,
27                __uuidof(MSXML2::ISAXXMLReader),
28                (void **)&pXMLReader);
29
30        if( !FAILED(hr) ) {
[105]31                TestResults results(argv[1]);
[104]32                std::wcout << L"replaying sessions in " << argv[1] << std::endl;
[105]33                LogParser * parser = new LogParser(argv[2], 5000, &results, true);
[32]34                pXMLReader->putContentHandler(parser);
35                hr = pXMLReader->parseURL(argv[1]);
36                pXMLReader->Release();
[104]37                std::wcout << L"================================================" << std::endl;
38                std::wcout << L"replay completed" << std::endl;
[105]39                if( argc>=4 ) {
40                        results.write(argv[3]);
41                        std::wcout << L"results written to " << argv[3] << std::endl;
42                }
[32]43        }
44
45        CoUninitialize();
46
[104]47        std::wcout << L"press enter to exit ...";
[32]48        getchar();
49
50        return 0;
51}
52
Note: See TracBrowser for help on using the repository browser.