homescreensrv_plat/sapi_homescreenplugin/tsrc/group/checkunittestlog.pl
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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 #!/usr/bin/perl
       
    17 use XML::Twig;
       
    18 my $twig= new XML::Twig();
       
    19 
       
    20 $logpath = "\\epoc32\\winscw\\c\\shared\\EUnit\\Logs\\EUnit_log.xml";
       
    21 $twig->parsefile( $logpath);
       
    22 
       
    23 my $root= $twig->root;
       
    24 my $elt = $twig->root;
       
    25 my $failCount = 0;
       
    26 my $okCount = 0;
       
    27 
       
    28 while ($elt = $elt->next_elt('result')){
       
    29     if( $elt->att('status') eq "FAIL")
       
    30     	{
       
    31     	$failCount++;	
       
    32   		}
       
    33     elsif( $elt->att('status') eq "OK")
       
    34     	{
       
    35     	$okCount++;	
       
    36   		}
       
    37 }
       
    38 
       
    39 my $allCount = $failCount + $okCount;
       
    40 print "\nUnit testing results:\n\n";
       
    41 print $allCount;
       
    42 print " unit tests run.\n";
       
    43 print $okCount;
       
    44 print " unit tests passed.\n";
       
    45 print $failCount;
       
    46 print " unit tests failed.\n";
       
    47 print "\n";
       
    48 
       
    49 if( $failCount > 0)
       
    50 	{
       
    51 	#system("explorer $logpath");	
       
    52 	}