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