587
|
1 |
#============================================================================
|
|
2 |
#Name : test_build_io.py
|
|
3 |
#Part of : Helium
|
|
4 |
|
|
5 |
#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
6 |
#All rights reserved.
|
|
7 |
#This component and the accompanying materials are made available
|
|
8 |
#under the terms of the License "Eclipse Public License v1.0"
|
|
9 |
#which accompanies this distribution, and is available
|
|
10 |
#at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
11 |
#
|
|
12 |
#Initial Contributors:
|
|
13 |
#Nokia Corporation - initial contribution.
|
|
14 |
#
|
|
15 |
#Contributors:
|
|
16 |
#
|
|
17 |
#Description:
|
|
18 |
#===============================================================================
|
|
19 |
|
|
20 |
""" Test the build.io module. """
|
628
|
21 |
# pylint: disable=R0201
|
588
|
22 |
#method could be a function warning removed
|
587
|
23 |
|
|
24 |
import logging
|
|
25 |
import unittest
|
|
26 |
import os
|
|
27 |
import build.io
|
|
28 |
|
|
29 |
|
588
|
30 |
_logger = logging.getLogger('test.build.io')
|
587
|
31 |
|
|
32 |
|
|
33 |
class AbldLogWhatReaderTest(unittest.TestCase):
|
|
34 |
""" Test reading Symbian build logs for extracting abld -what sections. """
|
|
35 |
|
|
36 |
def test_abld_what_parsing(self):
|
|
37 |
""" Basic abld -what section parsing. """
|
|
38 |
reader = build.io.AbldLogWhatReader(os.path.join(os.environ['TEST_DATA'], 'data/build/io/abld_what.log'))
|
|
39 |
reader_iter = iter(reader)
|
|
40 |
(component1, binaries1) = reader_iter.next()
|
|
41 |
assert component1 == 'ibusal_chipset_product'
|
|
42 |
assert binaries1 == [r'\epoc32\release\ARMV5\UDEB\_product_NaviScrollPdd.pdd',
|
|
43 |
r'\epoc32\release\ARMV5\UDEB\_product_NaviScrollPdd.pdd.map']
|
|
44 |
|
|
45 |
(component2, binaries2) = reader_iter.next()
|
|
46 |
assert component2 == 'ibusal_chipset_product2'
|
|
47 |
assert binaries2 == [r'\epoc32\release\ARMV5\UDEB\_product2_accelerometerpdd.pdd',
|
|
48 |
r'\epoc32\release\ARMV5\UDEB\_product2_accelerometerpdd.pdd.map']
|
|
49 |
|
|
50 |
class RombuildLogBinarySizeReaderTest(unittest.TestCase):
|
|
51 |
""" Test reading Symbian ROM build logs for extracting binaries and their sizes. """
|
|
52 |
|
|
53 |
def test_rom_log_parsing(self):
|
|
54 |
""" Basic ROM log binary size parsing. """
|
|
55 |
reader = build.io.RombuildLogBinarySizeReader(os.path.join(os.environ['TEST_DATA'], 'data/build/io/test_rom.log'))
|
|
56 |
reader_iter = iter(reader)
|
|
57 |
(binary, size, rom_type) = reader_iter.next()
|
|
58 |
assert binary == r'\epoc32\release\ARMV5\urel\__ekern.exe'
|
|
59 |
assert size == 221788
|
|
60 |
assert rom_type == 'rom'
|
|
61 |
|
|
62 |
(binary, size, rom_type) = reader_iter.next()
|
|
63 |
assert binary == r'\epoc32\release\ARMV5\urel\elocd.ldd'
|
|
64 |
assert size == 15192
|
|
65 |
assert rom_type == 'rom'
|
|
66 |
|
|
67 |
(binary, size, rom_type) = reader_iter.next()
|
|
68 |
assert binary == r'\epoc32\release\ARMV5\urel\__medint.pdd'
|
|
69 |
assert size == 2320
|
|
70 |
assert rom_type == 'rom'
|
|
71 |
|
|
72 |
def test_rofs_log_parsing(self):
|
|
73 |
""" Basic ROFS log binary size parsing. """
|
|
74 |
reader = build.io.RombuildLogBinarySizeReader(os.path.join(os.environ['TEST_DATA'], 'data/build/io/test_rofs.log'))
|
|
75 |
reader_iter = iter(reader)
|
|
76 |
(binary, size, rom_type) = reader_iter.next()
|
|
77 |
assert binary == r'\epoc32\data\Z\Resource\ICL\jpegcodec_extra.rsc'
|
|
78 |
assert size == 202
|
|
79 |
assert rom_type == 'rofs'
|
|
80 |
|
|
81 |
(binary, size, rom_type) = reader_iter.next()
|
|
82 |
assert binary == r'\epoc32\release\ARMV5\urel\jpegcodec.dll'
|
|
83 |
assert size == 89728
|
|
84 |
assert rom_type == 'rofs'
|
|
85 |
|