diff -r 39bb7c3571e9 -r 052078dda061 networksecurity/tls/test/codenomicon/TLS test wrapper/TestWrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networksecurity/tls/test/codenomicon/TLS test wrapper/TestWrapper.cpp Tue Jun 29 19:20:22 2010 +0530 @@ -0,0 +1,940 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include +#include +#include +#include +#include + + +using namespace std; +STARTUPINFO startupInfo; +PROCESS_INFORMATION processInfo; +STARTUPINFO startupInfoTls; +PROCESS_INFORMATION processInfoTls; +const char* CodenomiconPath = "C:/Program Files/Codenomicon/tlsc-31/testtool/tlsc-31.jar"; +const char* TestToolWrapperPath = "D:\\TlsTestWrapper\\"; + +int ReadConfigurations(const string& fileName, string& configSettings); +int GetPlatformAndBuild(const string& fileName, string& platform, string& build); +int RunTlsTestTool(const string& config, const string& jarPath); +int RunEpocTlsTest(const string& platform, const string& build); +int ParseLog(const string& fileDir, string& reportName); +int GetLogDirectory(const string& configFileName, string& logDir); +void ConvertPath(string& path); +int GetPlatformAndBuild(const string& fileName, string& platform, string& build); +void GetEpocDrive(string& drive); +void RemoveSpacesAround(string& inString); +int EpocPreTestConfig(const string& drive, const string& platform, const string& build); +int EpocPostTestConfig(const string& drive, const string& platform, const string& build); +void WaitForEpocTest(); + +/* this function is used to read the configuration settings from the config file + for Codenomicon TLS Client test tool + + its parameters are: + 1) fileName(in): this contains the name of the config file + 2) configSettings(out): on return, this contains the configuration settings +*/ +int ReadConfigurations(const string& fileName, string& configSettings) + { + ifstream configFile(fileName.c_str()); + if(configFile.is_open()) + { + string configLine; + + // go to the codenomicon params section + getline(configFile,configLine); + while(configLine.find("[params]", 0) == string::npos) + { + getline(configFile,configLine); + if(configFile.eof()) + { + cout<<"\ncould not find [params] section in config file"<