|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of the License "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # |
|
16 |
|
17 from raptor_tests import SmokeTest, ReplaceEnvs |
|
18 from xml.etree.ElementTree import parse |
|
19 |
|
20 def run(): |
|
21 t = SmokeTest() |
|
22 t.id = "84" |
|
23 t.name = "xml_invalid_chars" |
|
24 t.description = """Tests the validity of XML when output with characters |
|
25 not-allowed in XML are sent to the filters |
|
26 """ |
|
27 t.command = "sbs -b smoke_suite/test_resources/xml_invalid_chars/bld.inf " \ |
|
28 + "-c armv5" |
|
29 # The warning that causes the invalid characters to appear in the XML log |
|
30 t.warnings = 1 |
|
31 t.targets = [ |
|
32 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", |
|
33 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe" |
|
34 ] |
|
35 t.addbuildtargets('smoke_suite/test_resources/xml_invalid_chars/bld.inf', [ |
|
36 "test_/armv5/urel/test_urel_objects.via", |
|
37 "test_/armv5/urel/test.o.d", |
|
38 "test_/armv5/urel/test.o", |
|
39 "test_/armv5/udeb/test_udeb_objects.via", |
|
40 "test_/armv5/udeb/test.o.d", |
|
41 "test_/armv5/udeb/test.o" |
|
42 ]) |
|
43 |
|
44 t.run() |
|
45 |
|
46 if t.result == SmokeTest.PASS: |
|
47 |
|
48 print "Testing validity of XML..." |
|
49 |
|
50 log = "$(EPOCROOT)/epoc32/build/smoketestlogs/xml_invalid_chars.log" |
|
51 logfile = open(ReplaceEnvs(log), "r") |
|
52 |
|
53 try: |
|
54 tree = parse(logfile) |
|
55 except: |
|
56 t.result = SmokeTest.FAIL |
|
57 |
|
58 t.print_result() |
|
59 return t |