sbsv2/raptor/test/smoke_suite/dependencies.py
author yiluzhu
Tue, 23 Feb 2010 14:22:19 +0000
branchfix
changeset 247 8426d4dedf84
parent 225 d401dbd3a410
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     1
#
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     2
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     3
# All rights reserved.
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     4
# This component and the accompanying materials are made available
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     6
# which accompanies this distribution, and is available
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     8
#
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
     9
# Initial Contributors:
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    11
#
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    12
# Contributors:
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    13
#
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    14
# Description: 
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    15
#
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    16
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    17
from raptor_tests import AntiTargetSmokeTest
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    18
from raptor_meta import BldInfFile
225
d401dbd3a410 Ensure that parallel parsing sbs calls pass on --no-depend-generate and --no-depend-include (as these influence makefile generation).
Jon Chatten
parents: 221
diff changeset
    19
import os
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    20
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    21
def run():
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    22
	t = AntiTargetSmokeTest()
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    23
	t.usebash = True
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    24
	
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    25
	genericTargets = [
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    26
		"$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    27
		"$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe.map",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    28
		"$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    29
		"$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe.map",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    30
		"$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    31
		"$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe.map",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    32
		"$(EPOCROOT)/epoc32/release/winscw/udeb/dependency.exe",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    33
		"$(EPOCROOT)/epoc32/include/dependency.rsg",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    34
		"$(EPOCROOT)/epoc32/data/z/resource/apps/dependency.rsc",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    35
		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/dependency.rsc",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    36
		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/dependency.rsc",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    37
		"$(EPOCROOT)/epoc32/include/main.rsg",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    38
		"$(EPOCROOT)/epoc32/data/z/resource/apps/main.rsc",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    39
		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/main.rsc",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    40
		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/main.rsc"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    41
		]
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    42
	windowsTargets = [
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    43
		"$(EPOCROOT)/epoc32/release/tools2/rel/dependency.exe",
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    44
		"$(EPOCROOT)/epoc32/tools/dependency.exe"
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    45
	]
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    46
	linuxTargets = [
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    47
		"$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM_DIR)/rel/dependency",
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    48
		"$(EPOCROOT)/epoc32/tools/dependency"
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    49
	]
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    50
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    51
	# Set general host platform specifics from first test run, but assume Windows initially
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    52
	hostPlatform = "windows"
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    53
	hostPlatformTargets = genericTargets + windowsTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    54
	hostPlatformOffset = ""
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    55
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    56
	t.id = "0098a"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    57
	t.name = "baseline_build"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    58
	t.description = "Build a component with source and resource files that are dependent on header files exported in the build"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    59
	t.command = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    60
		cp smoke_suite/test_resources/dependencies/src/dependency1.cpp smoke_suite/test_resources/dependencies/dependency.cpp
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    61
		cp smoke_suite/test_resources/dependencies/src/dependency1.rss smoke_suite/test_resources/dependencies/dependency.rss
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    62
		sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""		
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    63
	t.mustnotmatch = [
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    64
		"<warning>Missing dependency detected: .*</warning>"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    65
	]
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    66
	t.targets = hostPlatformTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    67
	t.run(hostPlatform)
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    68
	if t.result == AntiTargetSmokeTest.SKIP:
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    69
		hostPlatform = "linux"
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    70
		hostPlatformTargets = genericTargets + linuxTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    71
		hostPlatformOffset = "$(HOSTPLATFORM_DIR)/"
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    72
		t.targets = hostPlatformTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    73
		t.run(hostPlatform)
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    74
	
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    75
	# Ensure we don't clean up from the previous build in the following two tests
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    76
	t.targets = []
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    77
	
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    78
	# Core expected outcome for the following two tests
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    79
	t.mustmatch = [
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    80
		".*recipe name='compile' target='.*dependency\.o'",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    81
		".*recipe name='win32compile2object' target='.*dependency\.o'",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    82
		".*recipe name='compile2object' target='.*dependency\.o'",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    83
		".*recipe name='resourcecompile' target='.*dependency\.rsc'"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    84
	]
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    85
	t.countmatch = [
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    86
		[".*recipe name='compile'", 2],
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    87
		[".*recipe name='win32compile2object'", 2],
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    88
		[".*recipe name='compile2object'", 1],
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    89
		[".*recipe name='resourcecompile'", 1]
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    90
	]
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
    91
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    92
	
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    93
	t.id = "0098b"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    94
	t.name ="touched_header_dependencies"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    95
	t.description = "Touch the exported header files and check that only the related source and resource files are re-built"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    96
	t.command = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    97
		sleep 1
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    98
		touch $(EPOCROOT)/epoc32/include/dependency.h
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
    99
		touch $(EPOCROOT)/epoc32/include/dependency.rh
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   100
		sbs -f- -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   101
	t.run()
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   102
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   103
	
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   104
	t.id = "0098c"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   105
	t.name ="redundant_header_dependencies"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   106
	t.description = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   107
		Build the component again, but manipulate it so that (a) it no longer has a dependency on the exported header files and
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   108
		(b) the header files have been removed and (c) the header files are no longer exported.  Check that only the related source
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   109
		and resource files are re-built"""
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   110
	t.command = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   111
		cp smoke_suite/test_resources/dependencies/src/dependency2.cpp smoke_suite/test_resources/dependencies/dependency.cpp
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   112
		cp smoke_suite/test_resources/dependencies/src/dependency2.rss smoke_suite/test_resources/dependencies/dependency.rss
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   113
		rm -rf $(EPOCROOT)/epoc32/include/dependency.h
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   114
		rm -rf $(EPOCROOT)/epoc32/include/dependency.rh
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   115
		sbs -f- --noexport -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   116
	t.mustnotmatch = []
219
c3543adfd26e Add --no-depend-generate to the front-end CLI.
Jon Chatten
parents: 218
diff changeset
   117
	# Note that the resource build does not exhibit a missing dependency as its dependency files are generated in a separate stage where
c3543adfd26e Add --no-depend-generate to the front-end CLI.
Jon Chatten
parents: 218
diff changeset
   118
	# the target file isn't actually a target of that stage
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   119
	t.mustmatch.extend([
219
c3543adfd26e Add --no-depend-generate to the front-end CLI.
Jon Chatten
parents: 218
diff changeset
   120
		"<warning>Missing dependency detected: .*/epoc32/include/dependency.h</warning>"
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   121
		])
219
c3543adfd26e Add --no-depend-generate to the front-end CLI.
Jon Chatten
parents: 218
diff changeset
   122
	t.warnings = 1
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   123
	t.run()
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   124
	
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   125
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   126
	t.id = "0098d"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   127
	t.name ="invalid_dependency_files"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   128
	t.description = "Invalidate dependency files, then make sure we can clean and re-build successfully"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   129
	buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   130
	t.command = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   131
		sleep 1
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   132
		touch smoke_suite/test_resources/dependencies/dependency.cpp
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   133
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   134
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   135
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   136
		echo INVALIDATE_RESOURCE_DEPENDENCY_FILE >> """+buildLocation+"""/dependency__resource_apps_sc.rpp.d
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   137
		sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   138
		sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel clean
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   139
		sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   140
	t.mustmatch = []
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   141
	t.countmatch = []
219
c3543adfd26e Add --no-depend-generate to the front-end CLI.
Jon Chatten
parents: 218
diff changeset
   142
	t.warnings = 0
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   143
	t.errors = 1 # We expect an error from the first build due to the deliberate dependency file corruption
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   144
	t.targets = hostPlatformTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   145
	t.run(hostPlatform)
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   146
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   147
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   148
	t.id = "0098e"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   149
	t.name ="no_depend_include"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   150
	t.description = "Invalidate dependency files in order to confirm they aren't processed when --no-depend-include is used"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   151
	buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   152
	t.command = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   153
		sleep 1
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   154
		touch smoke_suite/test_resources/dependencies/dependency.cpp
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   155
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   156
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   157
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   158
		sbs --no-depend-include -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   159
	t.errors = 0		
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   160
	t.targets = hostPlatformTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   161
	t.run(hostPlatform)
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   162
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   163
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   164
	t.id = "0098f"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   165
	t.name ="no_depend_generate"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   166
	t.description = "Invalidate and remove dependency files in order to confirm they are neither included nor re-generated when --no-depend-generate is used"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   167
	buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   168
	t.command = """
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   169
		sleep 1
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   170
		touch smoke_suite/test_resources/dependencies/dependency.cpp
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   171
		touch smoke_suite/test_resources/dependencies/main.cpp
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   172
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   173
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   174
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   175
		sbs --no-depend-generate -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   176
	t.antitargets = [
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   177
		buildLocation+"/armv5/urel/main.o.d",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   178
		buildLocation+"/armv5/udeb/main.o.d",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   179
		buildLocation+"/winscw/urel/main.o.d",
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   180
		buildLocation+"/winscw/udeb/main.o.d",
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   181
		buildLocation+"/dependency_exe/tools2/rel/"+hostPlatformOffset+"main.o.d"
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   182
		]
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   183
	t.targets = hostPlatformTargets
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   184
	t.run(hostPlatform)
225
d401dbd3a410 Ensure that parallel parsing sbs calls pass on --no-depend-generate and --no-depend-include (as these influence makefile generation).
Jon Chatten
parents: 221
diff changeset
   185
	
d401dbd3a410 Ensure that parallel parsing sbs calls pass on --no-depend-generate and --no-depend-include (as these influence makefile generation).
Jon Chatten
parents: 221
diff changeset
   186
	# clean-up
d401dbd3a410 Ensure that parallel parsing sbs calls pass on --no-depend-generate and --no-depend-include (as these influence makefile generation).
Jon Chatten
parents: 221
diff changeset
   187
	os.remove("smoke_suite/test_resources/dependencies/dependency.cpp")
d401dbd3a410 Ensure that parallel parsing sbs calls pass on --no-depend-generate and --no-depend-include (as these influence makefile generation).
Jon Chatten
parents: 221
diff changeset
   188
	os.remove("smoke_suite/test_resources/dependencies/dependency.rss")
218
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   189
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   190
	t.id = "98"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   191
	t.name = "dependencies"
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   192
	t.print_result()
08ca0919c66d First draft tests covering new dependency functionality.
Jon Chatten
parents:
diff changeset
   193
	return t
221
8653efb0b76b Update tests to deal with tools2 Linux build differences.
Jon Chatten
parents: 219
diff changeset
   194