testexecfw/stf/stfui/stf/src/helper.cpp
changeset 2 8bb370ba6d1d
equal deleted inserted replaced
1:bbd31066657e 2:8bb370ba6d1d
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 #include "helper.h"
       
    18 
       
    19 _LIT(KVersion, "STF console based executor, version: 1.0.0");
       
    20 _LIT(KRelDate, "2009-12-03");
       
    21 
       
    22 CHelper::CHelper(CConsoleBase* aConsole) : iConsole(aConsole)
       
    23     {}
       
    24 
       
    25 CHelper::~CHelper()
       
    26     {
       
    27     }
       
    28 
       
    29 CHelper* CHelper::NewL(CConsoleBase* aConsole)
       
    30     {
       
    31     CHelper* self = new(ELeave) CHelper(aConsole);
       
    32     CleanupStack::PushL(self);
       
    33     self->ConstructL();
       
    34     CleanupStack::Pop();
       
    35     return self;
       
    36     }
       
    37 
       
    38 void CHelper::ConstructL()
       
    39     {
       
    40     //Nothing to do.
       
    41     }
       
    42 
       
    43 void CHelper::ShowVersion()
       
    44     {
       
    45         
       
    46     iConsole->Printf(_L("* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).\n"));
       
    47     iConsole->Printf(_L("* All rights reserved.\n"));
       
    48     iConsole->Printf(_L("* This component and the accompanying materials are made available\n"));
       
    49     iConsole->Printf(_L("* under the terms of \"Eclipse Public License v1.0\"\n"));
       
    50     iConsole->Printf(_L("* which accompanies this distribution, and is available\n"));
       
    51     iConsole->Printf(_L("* at the URL \"http://www.eclipse.org/legal/epl-v10.html\".\n"));
       
    52     iConsole->Printf(_L("*\n"));
       
    53     iConsole->Printf(_L("* Nokia Corporation\n"));
       
    54     iConsole->Printf(_L("\n"));
       
    55     iConsole->Printf(_L("\n"));
       
    56     iConsole->Printf(_L("\n"));
       
    57         
       
    58     //variables used to get version of STIF
       
    59     TInt majorV;
       
    60     TInt minorV;
       
    61     TInt buildV;
       
    62     TBuf<30> relDate;
       
    63     TStifUtil::STIFVersion(majorV, minorV, buildV, relDate);
       
    64     
       
    65     TBuf<50> version;
       
    66     version.Format(_L("STF v%d.%d.%d - "), majorV, minorV, buildV);
       
    67     version.Append(relDate);
       
    68     version.Append(_L("\n"));
       
    69     
       
    70     iConsole->Printf(version);  //printing STIF version information (version and release date)
       
    71     
       
    72     TBuf<100> toolversion;
       
    73     toolversion.Append(KVersion);
       
    74     toolversion.Append(_L(" - Release at:"));
       
    75     toolversion.Append(KRelDate);
       
    76     toolversion.Append(_L("\n"));
       
    77     iConsole->Printf(toolversion);
       
    78     iConsole->Printf(_L("\n"));
       
    79     }
       
    80 
       
    81 
       
    82 void CHelper::ShowHelp()
       
    83     {
       
    84     TSize screenSize;
       
    85     screenSize = iConsole->ScreenSize();
       
    86     
       
    87     iConsole->Printf(_L("Usage: stf [-option value] [--parameter value] [case name/case index]\n"));
       
    88     iConsole->Printf(_L("\n"));
       
    89     iConsole->Printf(_L("where options include:\n"));
       
    90     iConsole->Printf(_L("\n"));
       
    91     iConsole->Printf(_L("-m <modulename>\n"));
       
    92     iConsole->Printf(_L("-s <script file path>\n"));
       
    93     iConsole->Printf(_L("-i <engine initialization file path>\n"));
       
    94     iConsole->Printf(_L("-c <module initialization file path>\n"));
       
    95     iConsole->Printf(_L("-engine <configuration item> <value>\n"));
       
    96     iConsole->Printf(_L("-log <configuration item> <value>\n"));
       
    97     iConsole->Printf(_L("-p <item> <value>\n"));
       
    98     iConsole->Printf(_L("-v  display version information\n"));
       
    99     iConsole->Printf(_L("-NOPROMPT exit without prompt when the execution finished.\n"));
       
   100     iConsole->Printf(_L("-?/-h  display this help information.\n"));
       
   101     iConsole->Printf(_L("\n"));
       
   102     iConsole->Printf(_L("For example:\n"));
       
   103     iConsole->Printf(_L("stf -m demomodule 3\n"));
       
   104     iConsole->Printf(_L("\n"));
       
   105     iConsole->Printf(_L("\n"));
       
   106     }
       
   107 
       
   108