Make copyfromannofile test work on windows. fix
authortimothy.murphy@nokia.com
Tue, 20 Apr 2010 13:41:38 +0100
branchfix
changeset 490 b60bdff41580
parent 489 4d8a8d0b17c0
child 491 f60c4282816c
child 492 9f47b050a32f
child 528 f6aa47076e0f
child 529 b74730c98ccc
Make copyfromannofile test work on windows.
sbsv2/raptor/python/raptor_make.py
sbsv2/raptor/test/smoke_suite/annofile2log.py
sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py
--- a/sbsv2/raptor/python/raptor_make.py	Tue Apr 20 12:08:50 2010 +0100
+++ b/sbsv2/raptor/python/raptor_make.py	Tue Apr 20 13:41:38 2010 +0100
@@ -68,7 +68,10 @@
 def AnnoFileParseOutput(annofile):
 	""" A generator that extracts log output from an emake annotation file, 
 	    perform an XML-unescape on it and "yields" it line by line.  """
-	af = open(annofile, "r")
+	if isinstance(annofile,str):
+		af = open(annofile, "r")
+	else:
+		af = annofile
 
 	inOutput = False
 
--- a/sbsv2/raptor/test/smoke_suite/annofile2log.py	Tue Apr 20 12:08:50 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/annofile2log.py	Tue Apr 20 13:41:38 2010 +0100
@@ -26,7 +26,7 @@
 	t.errors = 0
 	t.returncode = 0
 	t.exceptions = 0
-	t.command = "cd smoke_suite/test_resources/annofile2log && ( diff -wB <(python testanno2log.py <(bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2)) <(bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2))"
+	t.command = 'cd smoke_suite/test_resources/annofile2log && ( FROMANNO="`mktemp`" ; bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2 | python testanno2log.py  >"${FROMANNO}" && FROMSTDOUT="`mktemp`"; bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2 > "${FROMSTDOUT}" && diff -wB "${FROMANNO}" "${FROMSTDOUT}"; RET=$? ; rm "${FROMANNO}" "${FROMSTDOUT}"; exit $RET )'
 	
 	t.mustmatch_multiline = [ 
 		"^ *.?"
--- a/sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py	Tue Apr 20 12:08:50 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py	Tue Apr 20 13:41:38 2010 +0100
@@ -27,7 +27,10 @@
 retcode=0
 
 
-annofile = sys.argv[1]
+if len(sys.argv) > 1:
+	annofile = sys.argv[1]
+else:
+	annofile = sys.stdin
 
 sys.stdout.write("<build>\n")
 try: