sbsv2/raptor/test/smoke_suite/user_tools.py
author raptorbot <raptorbot@systemstesthead.symbian.intra>
Tue, 24 Nov 2009 01:13:22 +0000
branchwip
changeset 17 d5821e136caa
parent 9 b211d87c390a
permissions -rw-r--r--
Some test fixes Also remove regenerated trace headers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     1
import os
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     2
import sys
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     3
from raptor_tests import SmokeTest
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     4
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     5
def run():
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     6
	
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     7
	t = SmokeTest()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     8
	t.id = "86"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     9
	t.name = "user_tools"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    10
	
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    11
	if sys.platform.lower().startswith("win"):
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    12
		result = SmokeTest.PASS
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    13
		t.logfileOption = lambda :""
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    14
		t.makefileOption = lambda :""
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    15
		t.description = "Tests that Raptor picks up SBS_PYTHON, SBS_CYGWIN " \
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    16
				+ "and SBS_MINGW from the environment when present"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    17
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    18
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    19
		t.id = "0086a"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    20
		t.name = "user_python"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    21
		t.environ['SBS_PYTHON'] = "C:/pyt*hon"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    22
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    23
		t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel" \
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    24
					+ " -n --toolcheck off -f " + t.logfile() + " -m " + t.makefile()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    25
				
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    26
		t.mustmatch = [
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    27
				"'C:/pyt\*hon' is not recognized as an internal or external command,",
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    28
				"operable program or batch file."
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    29
				]
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    30
		t.returncode = 9009
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    31
		t.run()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    32
		if t.result == SmokeTest.FAIL:
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    33
			result = SmokeTest.FAIL
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    34
	
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    35
	
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    36
		t.id = "0086b"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    37
		t.name = "user_cygwin"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    38
		t.environ = {}
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    39
		t.environ['SBS_CYGWIN'] = "C:/cygwin"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    40
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    41
		t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel" \
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    42
				+ " -n --toolcheck off -f " + t.logfile() + " -m " + t.makefile() \
9
b211d87c390a Update to 2.11.0 from perforce
timothy.murphy@nokia.com
parents: 5
diff changeset
    43
				+ " && $(__CYGWIN__)/bin/grep.exe -ir 'TALON_SHELL:=C:/cygwin/bin/sh.exe' " + t.makefile() + "_all.default"
5
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    44
				
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    45
		t.mustmatch = [
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    46
				"TALON_SHELL:=C:/cygwin/bin/sh.exe"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    47
				]
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    48
		t.returncode = 0
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    49
		t.run()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    50
		if t.result == SmokeTest.FAIL:
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    51
			result = SmokeTest.FAIL
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    52
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    53
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    54
		t.id = "0086c"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    55
		t.name = "user_mingw"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    56
		t.environ = {}
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    57
		t.environ['SBS_MINGW'] = "C:/mingw"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    58
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    59
		t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel" \
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    60
				+ " -n --toolcheck off -f " + t.logfile() + " -m " + t.makefile()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    61
				
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    62
		t.mustmatch = [
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    63
				"sbs: error: Preprocessor exception: \[Error 3\] The system cannot find the path specified"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    64
				]
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    65
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    66
		t.errors = 1
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    67
		t.returncode = 1
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    68
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    69
		t.run()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    70
		if t.result == SmokeTest.FAIL:
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    71
			result = SmokeTest.FAIL
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    72
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    73
		t.id = "86"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    74
		t.name = "user_tools"
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    75
		t.result = result
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    76
		t.print_result()
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    77
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    78
	else:
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    79
		t.run("windows")
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    80
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    81
		
593a8820b912 Team Wip branch
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    82
	return t