sbsv2/raptor/test/smoke_suite/romfile.py
author Ross Qin <ross.qin@nokia.com>
Tue, 30 Nov 2010 14:05:41 +0800
changeset 713 7b7f0409fc00
parent 674 37ee82a83d43
permissions -rw-r--r--
merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     1
#
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
     2
# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     3
# All rights reserved.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     8
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
     9
# Initial Contributors:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    11
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    12
# Contributors:
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    13
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    14
# Description: 
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    15
#
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    16
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    17
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    18
from raptor_tests import SmokeTest
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    19
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    20
def run():
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    21
	t = SmokeTest()
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    22
	t.description = """
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    23
		Tests the creation and content of an .iby romfile for the armv5.test
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    24
		configuration. Also tests for creation of relevant test batch files.
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    25
		"""	
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    26
	t.usebash = True
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    27
	# Don't allow -m or -f to be appended
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    28
	t.logfileOption = lambda :""
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    29
	t.makefileOption = lambda :""
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    30
	
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    31
	t.id = "55a"
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    32
	# Check content of iby file is correct
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    33
	# Check batch files are generated
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    34
	t.name = "romfile_general"
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    35
	
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    36
	t.command = "sbs -b $(EPOCROOT)/src/ongoing/group/romfile/other_name.inf " \
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    37
			+ "-c armv5.test ROMFILE -m ${SBSMAKEFILE} -f ${SBSLOGFILE} " \
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    38
			+ "&& cat $(EPOCROOT)/epoc32/rom/src/ongoing/group/romfile/armv5test.iby"
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    39
	
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    40
	t.targets = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    41
		"$(EPOCROOT)/epoc32/rom/src/ongoing/group/romfile/armv5test.iby",
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 641
diff changeset
    42
		"$(EPOCROOT)/epoc32/data/z/test/src_ongoing_romfile/armv5.auto.bat",
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 641
diff changeset
    43
		"$(EPOCROOT)/epoc32/data/z/test/src_ongoing_romfile/armv5.manual.bat"
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    44
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    45
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    46
	# Check the content of the generated .iby file.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    47
	t.mustmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    48
		# The comment that is put at the start of the file.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    49
		r".*// epoc32/rom/src/ongoing/group/romfile/armv5test\.iby\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    50
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    51
		# The batch files that are added by the build system.
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 641
diff changeset
    52
		r".*\ndata=/epoc32/data/z/test/src_ongoing_romfile/armv5\.auto\.bat test/armv5\.auto\.bat\n.*",
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 641
diff changeset
    53
		r".*\ndata=/epoc32/data/z/test/src_ongoing_romfile/armv5\.manual\.bat test/armv5\.manual\.bat\n.*",
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    54
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    55
		# Some normal files.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    56
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_rand\.exe\s+sys/bin/t_rand\.exe\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    57
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_swapfsys\.exe\s+sys/bin/t_swapfsys\.exe\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    58
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_localtime\.exe\s+sys/bin/t_localtime\.exe\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    59
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    60
		# Some files where the MMP file has the PAGED or UNPAGED keywords.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    61
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_pagestress\.exe\s+sys/bin/t_pagestress\.exe paged\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    62
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_fsys\.exe\s+sys/bin/t_fsys\.exe unpaged\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    63
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    64
		# Some files where the MMP file has the ROMTARGET or RAMTARGET keywords.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    65
		r".*\ndata=/epoc32/release/##MAIN##/##BUILD##/t_prel\.dll\s+/sys/bin/t_prel\.dll attrib=r\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    66
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+sys/bin/t_sysbin\.exe\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    67
		r".*\ndata=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+/sys/bin/t_sysbin_ram\.exe attrib=r\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    68
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+/sys/bin/t_sysbina\.exe\n.*",
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    69
		r".*\nfile=/epoc32/release/##MAIN##/##BUILD##/t_sysbin\.exe\s+/system/programs/t_sysbinb\.exe\n.*"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    70
		]
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    71
	t.mustnotmatch = [
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    72
		# Try to detect file paths that contain two or more slashes in a row,
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    73
		# without flagging C++ style comments.
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    74
		r"\w//+\w"
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    75
		]
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    76
	t.warnings = 0 if t.onWindows else 2
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    77
	t.run()
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    78
	
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    79
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    80
	t.id = "55b"
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    81
	# t.targets and t.warnings are the same as above and thus omitted
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    82
	t.name = "romfile_whatlog"
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    83
	t.command = "sbs -b $(EPOCROOT)/src/ongoing/group/romfile/other_name.inf " \
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    84
			+ "-c armv5.test ROMFILE -f -"
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    85
	
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    86
	t.mustmatch = [
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    87
		# Check whatlog output includes batch files and .iby file
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    88
		r".*/epoc32/rom/src/ongoing/group/romfile/armv5test.iby</build>.*",
674
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 641
diff changeset
    89
		r".*/epoc32/data/z/test/src_ongoing_romfile/armv5.auto.bat</build>.*",
37ee82a83d43 sbs version 2.15.3
Jon Chatten
parents: 641
diff changeset
    90
		r".*/epoc32/data/z/test/src_ongoing_romfile/armv5.manual.bat</build>.*"
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    91
		]
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    92
	t.mustnotmatch = []
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    93
	t.run()
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
    94
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
    95
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
    96
	t.id = "55c"
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
    97
	t.name = "romfile_mmp_include_twice"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
    98
	t.command = "sbs -b $(EPOCROOT)/src/e32test/group/bld.inf " \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
    99
	        + "-b $(EPOCROOT)/src/falcon/test/bld.inf " \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   100
			+ "-c armv5.test ROMFILE -m ${SBSMAKEFILE} -f ${SBSLOGFILE} " \
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   101
			+ "&& cat $(EPOCROOT)/epoc32/rom/src/e32test/group/armv5test.iby"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   102
	
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   103
	t.targets = [
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   104
		"$(EPOCROOT)/epoc32/rom/src/e32test/group/armv5test.iby"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   105
		]
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   106
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   107
	# Check the content of the generated .iby file
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   108
	t.mustmatch = [
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   109
		r".*\ndevice\[MAGIC\]=/epoc32/release/##KMAIN##/##BUILD##/d_nanowait\.ldd\s+sys/bin/d_nanowait\.ldd\n.*",
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   110
		r".*\ndevice\[MAGIC\]=/epoc32/release/##KMAIN##/##BUILD##/d_pagingexample_2_post.ldd\s+sys/bin/d_pagingexample_2_post.ldd\n.*",
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   111
		]
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   112
	t.mustnotmatch = [
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   113
		# These two files are from two mmp files that included in both bld.inf
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   114
		# They shouldn't be in the ROM
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   115
		r".*/d_medch.ldd\s.*"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   116
		r".*/d_dma.ldd\s.*"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   117
		]
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   118
	t.warnings = 0
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   119
	t.run()
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   120
641
8dd670a9f34f sbs version 2.15.2
Jon Chatten
parents: 625
diff changeset
   121
625
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   122
	t.id = "55"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   123
	t.name = "romfile"
a1925fb7753a sbs version 2.15.0
Richard Taylor <richard.i.taylor@nokia.com>
parents: 591
diff changeset
   124
	t.print_result()
591
22486c9c7b15 raptor v2.14.0
jjkang
parents:
diff changeset
   125
	return t