sbsv2/raptor/test/smoke_suite/whatcomp.py
author Daniel Jacobs <daniel.jacobs@nokia.com>
Thu, 01 Apr 2010 15:50:33 +0100
branchwip
changeset 450 63f3bc391c14
parent 297 7029b5be2b15
permissions -rw-r--r--
Fix mismatches in test names vs. file names.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     1
#
171
083d88a8550e Fixing qt_helloworld test id. Fixing copyright notices.
Iain Williamson <iain.williamson@nokia.com>
parents: 170
diff changeset
     2
# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     3
# All rights reserved.
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     4
# This component and the accompanying materials are made available
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     6
# which accompanies this distribution, and is available
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     8
#
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
     9
# Initial Contributors:
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    11
#
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    12
# Contributors:
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    13
#
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    14
# Description: 
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    15
#
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    16
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    17
from raptor_tests import SmokeTest
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    18
import generic_path
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    19
import os
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    20
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    21
def run():
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    22
	t = SmokeTest()
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    23
	t.usebash = True
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    24
	result = SmokeTest.PASS
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    25
137
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    26
	abs_epocroot = os.path.abspath(os.environ["EPOCROOT"])
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    27
	cwd = os.getcwd().replace("\\","/")
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    28
137
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    29
	relative_epocroot = os.path.relpath(abs_epocroot.replace("\\","/"),cwd)
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    30
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    31
	
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    32
	description = """This tests the whatcomp filter.  As a byproduct it uses (and thus smoke-tests) sbs_filter.py"""
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    33
	command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c %s -m ${SBSMAKEFILE} -f ${SBSLOGFILE} what  && " + \
137
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    34
		  "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE} &&" % relative_epocroot + \
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    35
		  "EPOCROOT='%s' sbs_filter --filters FilterWhatComp < ${SBSLOGFILE}"  % abs_epocroot
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    36
	targets = [
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    37
		]	
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    38
	buildtargets = [
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    39
		]
137
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    40
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    41
	mustmatch_pre = [
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    42
		"-- abld -w",
137
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    43
		".*Chdir .*/smoke_suite/test_resources/simple.*",
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    44
		relative_epocroot + "/epoc32/release/armv5/urel/test.exe",
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    45
		relative_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    46
		abs_epocroot + "/epoc32/release/armv5/urel/test.exe",
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    47
		abs_epocroot + "/epoc32/release/armv5/urel/test.exe.map",
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    48
	] 
137
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    49
	
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    50
	if os.sep == '\\':
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    51
		mustmatch = [ i.replace("\\", "\\\\" ).replace("/","\\\\") for i in mustmatch_pre ]
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    52
	else:
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    53
		mustmatch = mustmatch_pre
befd82d9c937 Test fixes for whatcomp test: Deal with slashes correctly. Use Python 264.
raptorbot <raptorbot@systemstesthead.symbian.intra>
parents: 124
diff changeset
    54
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    55
	mustnotmatch = [
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    56
	"error: no (CHECK|WHAT) information found"
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    57
	]
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    58
	warnings = 0
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    59
	
294
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    60
	t.id = "0106a"
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    61
	t.name = "whatcomp_basic"
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    62
	t.description = description
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    63
	t.command = command % "arm.v5.urel.gcce4_4_1"
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    64
	t.targets = targets
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    65
	t.mustmatch = mustmatch
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    66
	t.mustnotmatch = mustnotmatch
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    67
	t.warnings = warnings
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    68
	t.run()
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    69
450
63f3bc391c14 Fix mismatches in test names vs. file names.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents: 297
diff changeset
    70
	t.id = "0106b"
294
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    71
	t.name = "whatcomp_component_repeated"
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    72
	t.description = """
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    73
			It is possible for what information about a component to not be grouped
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    74
			(i.e. for multiple whatlogs tags relating to a single component to be 
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    75
			interspersed with whatlog tags relating to other components).  
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    76
			Raptor must cope with that and must *not* report missing files under 
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    77
			the wrong component name."""
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    78
	t.command = "sbs_filter --filters=FilterWhatComp < smoke_suite/test_resources/logexamples/what_component_repeated.log"
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    79
	t.targets = []
297
7029b5be2b15 SF Bug 2113 - make test actually test so that it would actually fail if the output was wrong.
timothy.murphy@nokia.com
parents: 296
diff changeset
    80
	t.mustmatch = [] 
7029b5be2b15 SF Bug 2113 - make test actually test so that it would actually fail if the output was wrong.
timothy.murphy@nokia.com
parents: 296
diff changeset
    81
	t.mustmatch_multiline = [ 
7029b5be2b15 SF Bug 2113 - make test actually test so that it would actually fail if the output was wrong.
timothy.murphy@nokia.com
parents: 296
diff changeset
    82
		"Chdir y:.ext.app.emailwizard.*epoc32.data.something.*"+
7029b5be2b15 SF Bug 2113 - make test actually test so that it would actually fail if the output was wrong.
timothy.murphy@nokia.com
parents: 296
diff changeset
    83
		"Chdir y:.sf.mw.gsprofilesrv.ftuwizardmodel.*epoc32.release.armv5.something.*"+
7029b5be2b15 SF Bug 2113 - make test actually test so that it would actually fail if the output was wrong.
timothy.murphy@nokia.com
parents: 296
diff changeset
    84
		"Chdir y:.ext.app.emailwizard.*epoc32.data.something_else"
294
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    85
		]
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    86
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    87
	t.mustnotmatch = []
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    88
	t.warnings = 0
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    89
	t.run()
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    90
660607a4d589 SF Bug 2113 - [Raptor] what/check filters can assign files to the wrong components
timothy.murphy@nokia.com
parents: 171
diff changeset
    91
	t.id = "0106"
450
63f3bc391c14 Fix mismatches in test names vs. file names.
Daniel Jacobs <daniel.jacobs@nokia.com>
parents: 297
diff changeset
    92
	t.name = "whatcomp"
124
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    93
	t.print_result()
e898967975af sbs_filter: Fix so that return code is 0 on success (was always 1)
timothy.murphy@nokia.com
parents:
diff changeset
    94
	return t