Bug 2420 - [Raptor] Output from recipes is mis-recognised as "what" output fix
authoryiluzhu
Tue, 27 Apr 2010 16:30:46 +0100
branchfix
changeset 492 9f47b050a32f
parent 490 b60bdff41580
child 493 4a86d5ea40ef
Bug 2420 - [Raptor] Output from recipes is mis-recognised as "what" output
sbsv2/raptor/python/plugins/filter_what.py
sbsv2/raptor/test/common/raptor_tests.py
sbsv2/raptor/test/smoke_suite/gnumakefile_what.py
sbsv2/raptor/test/smoke_suite/temtest.py
--- a/sbsv2/raptor/python/plugins/filter_what.py	Tue Apr 20 13:41:38 2010 +0100
+++ b/sbsv2/raptor/python/plugins/filter_what.py	Tue Apr 27 16:30:46 2010 +0100
@@ -90,13 +90,7 @@
 		
 		# repetitions is for tracking repeated lines in the output log
 		# when --check and --what are called
-		self.repetitions = {}
-		
-		"Regex for old what output"
-		if "win" in self.buildparameters.platform:
-			self.regex = re.compile("^[a-zA-Z]:\S+$")
-		else:
-			self.regex = re.compile("^/\S+$")
+		self.repetitions = {}	
 		
 		"Regex for targets"
 		self.target_regex = re.compile("^<(build|stringtable|resource|bitmap)>.*")
@@ -136,10 +130,6 @@
 				self.repetitions[line] = 0
 				
 			if self.repetitions[line] == 0:
-				
-				if self.regex.match(line) and (self.what or self.check):
-					"Print the whole line"
-					self.print_file(line, (-1), len(line))
 					
 				if self.target_regex.match(line):
 					"Grab the filename between <build> and </build>" 
--- a/sbsv2/raptor/test/common/raptor_tests.py	Tue Apr 20 13:41:38 2010 +0100
+++ b/sbsv2/raptor/test/common/raptor_tests.py	Tue Apr 27 16:30:46 2010 +0100
@@ -603,10 +603,14 @@
 		# paths in --what output are tailored to the host OS, hence slashes are converted appropriately
 		# .whatlog output is used verbatim from the build/TEM/EM output
 		self.hostossensitive = True
+		
+		# Indicate whether ouput is expected to appear only once. If so, set it to True
+		self.output_expected_only_once = False 
 	
 	def posttest(self):
 		outlines = self.output.splitlines()
-		
+		outlines_left = outlines 
+
 		ok = True
 		seen = []
 		
@@ -620,6 +624,7 @@
 				
 			if line in outlines:
 				seen.append(line)
+				outlines_left.remove(line) 
 			else:
 				print "OUTPUT NOT FOUND:", line
 				ok = False
@@ -631,6 +636,14 @@
 			if not line in seen:
 				print "UNEXPECTED OUTPUT:", line
 				ok = False
+				outlines_left.remove(line) 
+		
+		# and check for lines that we expected to see only once
+		if self.output_expected_only_once:
+			for line in outlines_left:
+				print "OUTPUT MORE THAN ONCE:", line
+				ok = False
+
 			
 		# do the base class things too
 		return (SmokeTest.posttest(self) and ok)	
--- a/sbsv2/raptor/test/smoke_suite/gnumakefile_what.py	Tue Apr 20 13:41:38 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/gnumakefile_what.py	Tue Apr 27 16:30:46 2010 +0100
@@ -23,7 +23,8 @@
 	t.name = "gnumakefile_what"
 	t.command = "sbs -b smoke_suite/test_resources/gnumakefile/bld.inf --what"
 	componentpath = re.sub(r'\\','/',os.path.abspath("smoke_suite/test_resources/gnumakefile"))
-
+	
+	t.output_expected_only_once = True
 	t.stdout = [
 	# Generated txt files by the gnumakefile
 		componentpath+"/master_bld_ARMV5_UDEB.txt",
--- a/sbsv2/raptor/test/smoke_suite/temtest.py	Tue Apr 20 13:41:38 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/temtest.py	Tue Apr 27 16:30:46 2010 +0100
@@ -98,6 +98,7 @@
 	t.id = "0018f"
 	t.name = "temwhat"
 	t.command = "sbs -b smoke_suite/test_resources/simple_extension/bld.inf --what"
+	t.output_expected_only_once = True	
 	t.stdout = [
 		# exports
 		'$(EPOCROOT)/epoc32/tools/makefile_templates/sbsv2test/clean.mk',