sbsv2/raptor/test/smoke_suite/whatcomp.py
author jjkang
Fri, 25 Jun 2010 19:56:45 +0800
changeset 604 b33dd54aaa52
parent 602 3145852acc89
permissions -rw-r--r--
add cpptoolsplat
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# Description: 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
from raptor_tests import SmokeTest
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
import generic_path
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
import os
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
def run():
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
	t = SmokeTest()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
	t.usebash = True
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
	result = SmokeTest.PASS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
	abs_epocroot = os.path.abspath(os.environ["EPOCROOT"])
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
	cwd = os.getcwd().replace("\\","/")
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
	relative_epocroot = os.path.relpath(abs_epocroot.replace("\\","/"),cwd)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
	description = """This tests the whatcomp filter.  As a byproduct it uses (and thus smoke-tests) sbs_filter.py"""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
	command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c %s -m ${SBSMAKEFILE} -f ${SBSLOGFILE} what  && " + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
		  "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE} &&" % relative_epocroot + \
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
		  "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE}"  % abs_epocroot
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
	targets = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
		]	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
	buildtargets = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
	mustmatch_pre = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
		"-- abld -w",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
		".*Chdir .*/smoke_suite/test_resources/simple.*",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
		relative_epocroot + "/epoc32/release/armv5/urel/test.exe",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
		relative_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
		abs_epocroot + "/epoc32/release/armv5/urel/test.exe",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
		abs_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
	] 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
	if os.sep == '\\':
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
		mustmatch = [ i.replace("\\", "\\\\" ).replace("/","\\\\") for i in mustmatch_pre ]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
	else:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
		mustmatch = mustmatch_pre
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
	mustnotmatch = [
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
	"error: no (CHECK|WHAT) information found"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
	]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
	warnings = 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
	t.id = "0106a"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
	t.name = "whatcomp_basic"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
	t.description = description
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
	t.command = command % "arm.v5.urel.gcce4_4_1"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
	t.targets = targets
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
	t.mustmatch = mustmatch
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
	t.mustnotmatch = mustnotmatch
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
	t.warnings = warnings
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
	t.run()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
	t.id = "0106b"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
	t.name = "whatcomp_component_repeated"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
	t.description = """
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
			It is possible for what information about a component to not be grouped
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
			(i.e. for multiple whatlogs tags relating to a single component to be 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
			interspersed with whatlog tags relating to other components).  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
			Raptor must cope with that and must *not* report missing files under 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
			the wrong component name."""
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
	t.command = "sbs_filter --filters=FilterWhatComp < smoke_suite/test_resources/logexamples/what_component_repeated.log"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
	t.targets = []
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
	t.mustmatch = [] 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
	t.mustmatch_multiline = [ 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
		"Chdir y:.ext.app.emailwizard.*epoc32.data.something.*"+
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
		"Chdir y:.sf.mw.gsprofilesrv.ftuwizardmodel.*epoc32.release.armv5.something.*"+
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
		"Chdir y:.ext.app.emailwizard.*epoc32.data.something_else"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
		]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
	t.mustnotmatch = []
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
	t.warnings = 0
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
	t.run()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
	t.id = "0106"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
	t.name = "whatcomp"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
	t.print_result()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
	return t