graphicstest/uibench/scripts/resultsmunger.py
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 # Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 # # Scans the working directory for files and processes them
       
    15 # # assuming they are the output from the te_uibench component
       
    16 # # Outputs a results.csv file that contains:-
       
    17 # # filename, testid1, result1, testid2, result2 etc
       
    18 # 
       
    19 #
       
    20 
       
    21 import os
       
    22 import dircache
       
    23 import re
       
    24 
       
    25 out_file = open("results.csv","w")
       
    26 
       
    27 files=dircache.listdir(os.getcwd())
       
    28 
       
    29 bitbltfinder = re.compile('.* ((.?)BitBlt(.?)) o: (.*), (.+)bit->(.*) mode - for (.*) bitmaps, per bitmap=(.*) .*')
       
    30 bitmapcreatefinder = re.compile('.* Bitmap->Create - for (.*) bitmaps, per bitmap=(.*) .*')
       
    31 bitmapdupfinder = re.compile('.* Bitmap->Duplicate - for (.*) bitmaps, per bitmap (.*) .*')
       
    32 fontdupfinder = re.compile('.* Font->Duplicate - for (.*) fonts, per font (.*) .*')
       
    33 solidcolourfinder = re.compile('.* (Rect->Fill) o: (.*), (.*) mode - colour: (.*) - per fill (.*) .*')
       
    34 
       
    35 count = 0
       
    36 while count < len(files):
       
    37     print 'files[',count,']=',files[count]
       
    38 
       
    39     if files[count] != "results.csv":
       
    40         
       
    41         out_file.write(files[count]+", ")
       
    42         
       
    43         in_file = open(files[count],"r")
       
    44         text = " "
       
    45         while text!="":
       
    46             text = in_file.readline()
       
    47 
       
    48             bcresult = bitmapcreatefinder.match(text)
       
    49             if bcresult:
       
    50                 print "BitmapCreate "+bcresult.group(2)
       
    51                 out_file.write("BitmapCreate, ")
       
    52                 out_file.write(bcresult.group(2)+", ")
       
    53             
       
    54             bdresult = bitmapdupfinder.match(text)
       
    55             if bdresult:
       
    56                 print "BitmapDuplicate "+bdresult.group(2)
       
    57                 out_file.write("BitmapDuplicate, ")
       
    58                 out_file.write(bdresult.group(2)+", ")
       
    59             
       
    60             fdresult = fontdupfinder.match(text)
       
    61             if fdresult:
       
    62                 print "FontDuplicate "+fdresult.group(2)
       
    63                 out_file.write("FontDuplicate, ")
       
    64                 out_file.write(fdresult.group(2)+", ")
       
    65 
       
    66             scresult = solidcolourfinder.match(text)
       
    67             if scresult:
       
    68                 test = scresult.group(1)+"-"+scresult.group(2)+"o-"+scresult.group(3)+"m"+scresult.group(4)+"c"
       
    69                 print "Solid Colour "+scresult.group(5)
       
    70                 out_file.write(test+", ")
       
    71                 out_file.write(scresult.group(5)+", ")
       
    72             
       
    73             result = bitbltfinder.match(text)
       
    74             if result:
       
    75                 test = result.group(1)+"-"+result.group(4)+"o-"+result.group(5)+"bit-"+result.group(6)+"m"
       
    76                 print test
       
    77                 print result.group(8)
       
    78                 out_file.write(test+", ")
       
    79                 out_file.write(result.group(8)+", ")
       
    80         in_file.close()
       
    81         out_file.write("\n")
       
    82         
       
    83     count = count + 1
       
    84 
       
    85 out_file.close()