apicompatanamdw/compatanalysercmd/headeranalyser/tsrc/scripts/hatestrun.py
author shrivatsa
Mon, 27 Sep 2010 14:51:17 +0530
changeset 12 a0eee409ff14
permissions -rw-r--r--
Updates to CompatibilityAnalyser - The Tool should now work with Symbian^4 - Some minor bug fixes related to Qt headers in the Symbian Platform
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     1
#
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     3
# All rights reserved.
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     4
# This component and the accompanying materials are made available
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     5
# under the terms of "Eclipse Public License v1.0"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     6
# which accompanies this distribution, and is available
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     8
#
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
     9
# Initial Contributors:
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    11
#
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    12
# Contributors:
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    13
#
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    14
# Description:
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    15
#
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    16
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    17
import sys
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    18
import os
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    19
import shutil
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    20
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    21
TC_NUM = sys.argv[1]
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    22
TC_FOLDER = os.getcwd()+os.sep+"TC"+os.sep+TC_NUM
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    23
SCRIPT_DIR = TC_FOLDER+os.sep+"scripts"+os.sep
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    24
RESULTS_DIR = TC_FOLDER+os.sep+"results"+os.sep
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    25
BBCRESULTS = os.pardir+os.sep+os.pardir+os.sep+"checkbc"+os.sep+"results"+os.sep+"BBCResults.xsl"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    26
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    27
if len(sys.argv) == 1:
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    28
    print "Usage: hatestrun testcase_name"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    29
    sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    30
    
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    31
if not os.path.exists(TC_FOLDER):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    32
    print "Test case directory cannot be found: " + TC_FOLDER
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    33
    sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    34
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    35
if not os.path.exists(SCRIPT_DIR+"prepare.txt"):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    36
    print "Cannot find file: " + SCRIPT_DIR + "prepare.txt"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    37
    sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    38
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    39
file = open( SCRIPT_DIR+"prepare.txt" )
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    40
BASEDIR = ((file.readline()).replace("\\",os.sep).replace("/",os.sep)).rstrip('\n\r ')
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    41
CURRDIR = ((file.readline()).replace("\\",os.sep).replace("/",os.sep)).rstrip('\n\r ')
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    42
RESDIR = ((file.readline()).replace("\\",os.sep).replace("/",os.sep)).rstrip('\n\r ')
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    43
file.close()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    44
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    45
print "Checking test case directories..."
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    46
if not os.path.exists(TC_FOLDER+os.sep+BASEDIR):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    47
    print "Cannot find base platform directory: " + TC_FOLDER+os.sep+BASEDIR
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    48
    sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    49
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    50
if not os.path.exists(TC_FOLDER+os.sep+CURRDIR):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    51
    print "Cannot find current platform directory: " + TC_FOLDER+os.sep+CURRDIR
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    52
    sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    53
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    54
if not os.path.exists(TC_FOLDER+os.sep+RESDIR):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    55
    print "Cannot find result directory: " + TC_FOLDER+os.sep+RESDIR
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    56
    sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    57
    
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    58
TC_BBCRESULTS =  TC_FOLDER+os.sep+RESDIR+os.sep +"BBCResults.xsl"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    59
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    60
if not os.path.exists( BBCRESULTS):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    61
    print "Cannot find BBCResults.xsl"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    62
else:
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    63
    shutil.copyfile(BBCRESULTS,TC_BBCRESULTS)
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    64
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    65
if os.path.exists(RESULTS_DIR+TC_NUM+"_results.xml"):
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    66
    os.remove(RESULTS_DIR+TC_NUM+"_results.xml")
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    67
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    68
print "---- Starting HeaderAnalyser ----"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    69
os.chdir(os.pardir+os.sep+"bin")
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    70
cmd = "ha -commandfile " + SCRIPT_DIR + TC_NUM + "_conf.txt"
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    71
os.system(cmd)
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    72
os.chdir(os.pardir+os.sep+"tsrc")
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    73
sys.exit()
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    74
a0eee409ff14 Updates to CompatibilityAnalyser
shrivatsa
parents:
diff changeset
    75