sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py
author timothy.murphy@nokia.com
Tue, 16 Mar 2010 16:40:50 +0000
branchfix
changeset 362 0ff20a0b1aa9
parent 357 b4baa7ca35a7
child 490 b60bdff41580
permissions -rw-r--r--
add a test for annofile2log workaround for log corruption
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
362
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     1
#
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     2
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     3
# All rights reserved.
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     4
# This component and the accompanying materials are made available
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     6
# which accompanies this distribution, and is available
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     8
#
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
     9
# Initial Contributors:
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    10
# Nokia Corporation - initial contribution.
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    11
#
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    12
# Contributors:
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    13
#
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    14
# Description: 
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    15
# Component description file
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    16
#
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    17
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    18
357
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    19
import sys
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    20
import os
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    21
sys.path.append(os.path.join(os.environ['SBS_HOME'],"python"))
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    22
362
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    23
from raptor_make import XMLEscapeLog
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    24
from raptor_make import AnnoFileParseOutput
357
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    25
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    26
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    27
retcode=0
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    28
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    29
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    30
annofile = sys.argv[1]
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    31
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    32
sys.stdout.write("<build>\n")
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    33
try:
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    34
	for l in XMLEscapeLog(AnnoFileParseOutput(annofile)):
362
0ff20a0b1aa9 add a test for annofile2log workaround for log corruption
timothy.murphy@nokia.com
parents: 357
diff changeset
    35
		sys.stdout.write(l)
357
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    36
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    37
except Exception,e:
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    38
	sys.stderr.write("error: " + str(e) + "\n")
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    39
	retcode = 1
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    40
sys.stdout.write("</build>\n")
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    41
b4baa7ca35a7 fix: emake log output corruption fix by using output from the annotation file.
timothy.murphy@nokia.com
parents:
diff changeset
    42
sys.exit(retcode)