5
|
1 |
import os
|
|
2 |
import sys
|
|
3 |
from raptor_tests import SmokeTest
|
|
4 |
|
|
5 |
def run():
|
|
6 |
|
|
7 |
t = SmokeTest()
|
|
8 |
t.id = "86"
|
|
9 |
t.name = "user_tools"
|
|
10 |
|
|
11 |
if sys.platform.lower().startswith("win"):
|
|
12 |
result = SmokeTest.PASS
|
|
13 |
t.logfileOption = lambda :""
|
|
14 |
t.makefileOption = lambda :""
|
|
15 |
t.description = "Tests that Raptor picks up SBS_PYTHON, SBS_CYGWIN " \
|
|
16 |
+ "and SBS_MINGW from the environment when present"
|
|
17 |
|
|
18 |
|
|
19 |
t.id = "0086a"
|
|
20 |
t.name = "user_python"
|
|
21 |
t.environ['SBS_PYTHON'] = "C:/pyt*hon"
|
|
22 |
|
|
23 |
t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel" \
|
|
24 |
+ " -n --toolcheck off -f " + t.logfile() + " -m " + t.makefile()
|
|
25 |
|
|
26 |
t.mustmatch = [
|
|
27 |
"'C:/pyt\*hon' is not recognized as an internal or external command,",
|
|
28 |
"operable program or batch file."
|
|
29 |
]
|
|
30 |
t.returncode = 9009
|
|
31 |
t.run()
|
|
32 |
if t.result == SmokeTest.FAIL:
|
|
33 |
result = SmokeTest.FAIL
|
|
34 |
|
|
35 |
|
|
36 |
t.id = "0086b"
|
|
37 |
t.name = "user_cygwin"
|
|
38 |
t.environ = {}
|
|
39 |
t.environ['SBS_CYGWIN'] = "C:/cygwin"
|
|
40 |
|
|
41 |
t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel" \
|
|
42 |
+ " -n --toolcheck off -f " + t.logfile() + " -m " + t.makefile() \
|
9
|
43 |
+ " && $(__CYGWIN__)/bin/grep.exe -ir 'TALON_SHELL:=C:/cygwin/bin/sh.exe' " + t.makefile() + "_all.default"
|
5
|
44 |
|
|
45 |
t.mustmatch = [
|
|
46 |
"TALON_SHELL:=C:/cygwin/bin/sh.exe"
|
|
47 |
]
|
|
48 |
t.returncode = 0
|
|
49 |
t.run()
|
|
50 |
if t.result == SmokeTest.FAIL:
|
|
51 |
result = SmokeTest.FAIL
|
|
52 |
|
|
53 |
|
|
54 |
t.id = "0086c"
|
|
55 |
t.name = "user_mingw"
|
|
56 |
t.environ = {}
|
|
57 |
t.environ['SBS_MINGW'] = "C:/mingw"
|
|
58 |
|
|
59 |
t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel" \
|
|
60 |
+ " -n --toolcheck off -f " + t.logfile() + " -m " + t.makefile()
|
|
61 |
|
|
62 |
t.mustmatch = [
|
|
63 |
"sbs: error: Preprocessor exception: \[Error 3\] The system cannot find the path specified"
|
|
64 |
]
|
|
65 |
|
|
66 |
t.errors = 1
|
|
67 |
t.returncode = 1
|
|
68 |
|
|
69 |
t.run()
|
|
70 |
if t.result == SmokeTest.FAIL:
|
|
71 |
result = SmokeTest.FAIL
|
|
72 |
|
|
73 |
t.id = "86"
|
|
74 |
t.name = "user_tools"
|
|
75 |
t.result = result
|
|
76 |
t.print_result()
|
|
77 |
|
|
78 |
else:
|
|
79 |
t.run("windows")
|
|
80 |
|
|
81 |
|
|
82 |
return t
|