sbsv2/raptor/test/smoke_suite/tracecompiler_general.py
branchfix
changeset 161 62c28226cde4
parent 3 e1eecf4d390d
child 163 c3eca3dd5925
equal deleted inserted replaced
52:ae46aeb3faf3 161:62c28226cde4
     1 
     1 
     2 from raptor_tests import SmokeTest
     2 from raptor_tests import CheckWhatSmokeTest
     3 from raptor_tests import AntiTargetSmokeTest
     3 from raptor_tests import AntiTargetSmokeTest
     4 
     4 
     5 def run():
     5 def run():
     6 	result = SmokeTest.PASS
     6 	result = CheckWhatSmokeTest.PASS
     7 	failed = []
     7 	failed = []
     8 
     8 
     9 	t = SmokeTest()
     9 	t = CheckWhatSmokeTest()
    10 	t.description = "Testcases (ID 0101a - 0101d) test trace compiler"
    10 	t.description = "Testcases (ID 0101a - 0101d) test trace compiler"
    11 	# General test for trace compiler, which generates
    11 	# General test for trace compiler, which generates
    12 	# 1. trace headers like <source>Traces.h
    12 	# 1. trace headers like <source>Traces.h
    13 	# 2. fixed_id.definitions
    13 	# 2. fixed_id.definitions
    14 	# 3. dictionary files like <project name>_<UID>_Dictionary.xml
    14 	# 3. dictionary files like <project name>_<UID>_Dictionary.xml
    47 		"testtc_dll/armv5/urel/wlanhwinitpermparser.o.d",	
    47 		"testtc_dll/armv5/urel/wlanhwinitpermparser.o.d",	
    48 		"testtc_dll/armv5/urel/testTC_urel_objects.via",
    48 		"testtc_dll/armv5/urel/testTC_urel_objects.via",
    49 		"testtc_dll/armv5/urel/testTC{000a0000}.def",
    49 		"testtc_dll/armv5/urel/testTC{000a0000}.def",
    50 		"testtc_dll/tracecompile_testTC_1000008d.done"
    50 		"testtc_dll/tracecompile_testTC_1000008d.done"
    51 	])
    51 	])
       
    52 	t.stdout = [
       
    53 		"<build>$(EPOCROOT)/epoc32/OST_Dictionaries/testTC_0x1000008d_Dictionary.xml</build>",
       
    54 		"<build>$(EPOCROOT)/epoc32/include/internal/SymbianTraces/autogen/testTC_0x1000008d_TraceDefinitions.h</build>"
       
    55 		]		
    52 	# Trace compiler doesn't work on Linux for time being. Once it's fixed, will apply all 
    56 	# Trace compiler doesn't work on Linux for time being. Once it's fixed, will apply all 
    53 	# trace compiler tests to linux as well.
    57 	# trace compiler tests to linux as well.
    54 	t.run("windows")
    58 	t.run("windows")
    55 	if t.result == SmokeTest.FAIL:
    59 	if t.result == CheckWhatSmokeTest.FAIL:
    56 		result = SmokeTest.FAIL
    60 		result = CheckWhatSmokeTest.FAIL
    57 		failed.append(t.name)
    61 		failed.append(t.name)
    58 
    62 
    59 	# General CLEAN test for trace compiler outputs
    63 	# General CLEAN test for trace compiler outputs
    60 	t = AntiTargetSmokeTest()
    64 	t = AntiTargetSmokeTest()
    61 	t.id = "101b"
    65 	t.id = "101b"
    68 		]
    72 		]
    69 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
    73 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
    70 		"testtc_dll/tracecompile_testTC_1000008d.done"
    74 		"testtc_dll/tracecompile_testTC_1000008d.done"
    71 	])
    75 	])
    72 	t.run("windows")
    76 	t.run("windows")
    73 	if t.result == SmokeTest.FAIL:
    77 	if t.result == CheckWhatSmokeTest.FAIL:
    74 		result = SmokeTest.FAIL
    78 		result = CheckWhatSmokeTest.FAIL
    75 		failed.append(t.name)
    79 		failed.append(t.name)
    76 		
    80 		
    77 	t = SmokeTest()
    81 	t = CheckWhatSmokeTest()
    78 	t.id = "101c"
    82 	t.id = "101c"
    79 	t.name = "TC_bv_path"
    83 	t.name = "TC_bv_path"
    80 	t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_featurevariant/group/bld.inf -c armv5.tracecompiler" 
    84 	t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_featurevariant/group/bld.inf -c armv5.tracecompiler" 
    81 	t.targets = [
    85 	t.targets = [
    82 		"$(EPOCROOT)/epoc32/release/armv5/udeb/HelloWorld.exe",
    86 		"$(EPOCROOT)/epoc32/release/armv5/udeb/HelloWorld.exe",
    95 		"helloworld_exe/armv5/urel/HelloWorld.o",
    99 		"helloworld_exe/armv5/urel/HelloWorld.o",
    96 		"helloworld_exe/armv5/urel/HelloWorld.o.d",
   100 		"helloworld_exe/armv5/urel/HelloWorld.o.d",
    97 		"helloworld_exe/armv5/urel/HelloWorld_urel_objects.via",
   101 		"helloworld_exe/armv5/urel/HelloWorld_urel_objects.via",
    98 		"helloworld_exe/tracecompile_HelloWorld_e78a5aa3.done"
   102 		"helloworld_exe/tracecompile_HelloWorld_e78a5aa3.done"
    99 	])
   103 	])
   100 	t.run("windows")
   104 	t.stdout = [
   101 	if t.result == SmokeTest.FAIL:
   105 		"<build>$(EPOCROOT)/epoc32/OST_Dictionaries/HelloWorld_0xe78a5aa3_Dictionary.xml</build>",
   102 		result = SmokeTest.FAIL
   106 		"<build>$(EPOCROOT)/epoc32/include/internal/SymbianTraces/autogen/HelloWorld_0xe78a5aa3_TraceDefinitions.h</build>"
       
   107 		]		
       
   108 	t.run("windows")
       
   109 	if t.result == CheckWhatSmokeTest.FAIL:
       
   110 		result = CheckWhatSmokeTest.FAIL
   103 		failed.append(t.name)
   111 		failed.append(t.name)
   104 	
   112 	
   105 	# 101d-101f test trace compiler auto mechanism, which is used to avoid wasting time on source 
   113 	# 101d-101f test trace compiler auto mechanism, which is used to avoid wasting time on source 
   106 	# containing no osttraces.
   114 	# containing no osttraces.
   107 	# Trace compiler only runs when there are osttraces code in source. Raptor decides this by
   115 	# Trace compiler only runs when there are osttraces code in source. Raptor decides this by
   108 	# checking whether there is a "traces" or "traces_<prj_name>" folder in USERINCLUDE in a mmp file. 
   116 	# checking whether there is a "traces" or "traces_<prj_name>" folder in USERINCLUDE in a mmp file. 
   109 	t = SmokeTest()
   117 	t = CheckWhatSmokeTest()
   110 	t.id = "101d"
   118 	t.id = "101d"
   111 	t.name = "TC_autorun1"
   119 	t.name = "TC_autorun1"
   112 	# Run - USERINCLUDE ../traces_autorun1
   120 	# Run - USERINCLUDE ../traces_autorun1
   113 	t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \
   121 	t.command = "sbs -b smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf -c armv5.tracecompiler" + \
   114 			" -p autorun1.mmp"
   122 			" -p autorun1.mmp"
   120 		"test_/armv5/udeb/test.o",
   128 		"test_/armv5/udeb/test.o",
   121 		"test_/armv5/urel/test.o",
   129 		"test_/armv5/urel/test.o",
   122 		"test_/tracecompile_autorun1_00000001.done"
   130 		"test_/tracecompile_autorun1_00000001.done"
   123 	])
   131 	])
   124 	t.run("windows")
   132 	t.run("windows")
   125 	if t.result == SmokeTest.FAIL:
   133 	if t.result == CheckWhatSmokeTest.FAIL:
   126 		result = SmokeTest.FAIL
   134 		result = CheckWhatSmokeTest.FAIL
   127 		failed.append(t.name)
   135 		failed.append(t.name)
   128 	
   136 	
   129 	t = AntiTargetSmokeTest()
   137 	t = AntiTargetSmokeTest()
   130 	t.id = "101e"
   138 	t.id = "101e"
   131 	t.name = "TC_autorun2"
   139 	t.name = "TC_autorun2"
   144 	])
   152 	])
   145 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
   153 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
   146 		"test_/tracecompile_autorun2_00000001.done"
   154 		"test_/tracecompile_autorun2_00000001.done"
   147 	])
   155 	])
   148 	t.run("windows")
   156 	t.run("windows")
   149 	if t.result == SmokeTest.FAIL:
   157 	if t.result == CheckWhatSmokeTest.FAIL:
   150 		result = SmokeTest.FAIL
   158 		result = CheckWhatSmokeTest.FAIL
   151 		failed.append(t.name)
   159 		failed.append(t.name)
   152 
   160 
   153 	t = AntiTargetSmokeTest()
   161 	t = AntiTargetSmokeTest()
   154 	t.id = "101f"
   162 	t.id = "101f"
   155 	t.name = "TC_autorun3"
   163 	t.name = "TC_autorun3"
   168 	])
   176 	])
   169 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
   177 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
   170 		"test_/tracecompile_autorun3_00000001.done"
   178 		"test_/tracecompile_autorun3_00000001.done"
   171 	])
   179 	])
   172 	t.run("windows")
   180 	t.run("windows")
   173 	if t.result == SmokeTest.FAIL:
   181 	if t.result == CheckWhatSmokeTest.FAIL:
   174 		result = SmokeTest.FAIL
   182 		result = CheckWhatSmokeTest.FAIL
   175 		failed.append(t.name)
   183 		failed.append(t.name)
   176 
   184 
   177 	# Test trace compiler doesn't run when it is switched off
   185 	# Test trace compiler doesn't run when it is switched off
   178 	# Trace compiler switch is off by default. To turn it on use variant ".tracecompiler". 
   186 	# Trace compiler switch is off by default. To turn it on use variant ".tracecompiler". 
   179 	t = AntiTargetSmokeTest()
   187 	t = AntiTargetSmokeTest()
   192 	])
   200 	])
   193 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
   201 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
   194 		"test_/tracecompile_autorun1_00000001.done"
   202 		"test_/tracecompile_autorun1_00000001.done"
   195 	])
   203 	])
   196 	t.run("windows")
   204 	t.run("windows")
   197 	if t.result == SmokeTest.FAIL:
   205 	if t.result == CheckWhatSmokeTest.FAIL:
   198 		result = SmokeTest.FAIL
   206 		result = CheckWhatSmokeTest.FAIL
   199 		failed.append(t.name)
   207 		failed.append(t.name)
   200 	
   208 	
   201 
   209 
   202 	t.name = "traceccompiler_general"
   210 	t.name = "traceccompiler_general"
   203 	t.result = result
   211 	t.result = result
   204 
   212 
   205 	print "\nOverall Result : " + result.upper() + "\n"
   213 	print "\nOverall Result : " + result.upper() + "\n"
   206 	if result == SmokeTest.FAIL:
   214 	if result == CheckWhatSmokeTest.FAIL:
   207 		print len(failed), "tests failed:"
   215 		print len(failed), "tests failed:"
   208 		for x in failed:
   216 		for x in failed:
   209 			print x
   217 			print x
   210 		print	
   218 		print	
   211 
   219