Exemplo n.º 1
0
def run():
    t = AntiTargetSmokeTest()
    t.name = "retry"
    #
    # -t 3 means try each recipe up to 3 times, if it fails.
    #
    # There are 3 FLM calls:
    #    retry_1 fails once then succeeds.
    #    retry_2 fails twice then succeeds.
    #    retry_3 fails all 3 times.
    #
    # use -k in case the retry_3 case happens to be run first.
    #
    t.command = "sbs -b smoke_suite/test_resources/retry/bld.inf -c armv5_urel -t 3 -k"
    t.targets = [
        "$(EPOCROOT)/epoc32/build/retry_1.1",
        "$(EPOCROOT)/epoc32/build/retry_1.ok",
        "$(EPOCROOT)/epoc32/build/retry_2.1",
        "$(EPOCROOT)/epoc32/build/retry_2.2",
        "$(EPOCROOT)/epoc32/build/retry_2.ok",
        "$(EPOCROOT)/epoc32/build/retry_3.1",
        "$(EPOCROOT)/epoc32/build/retry_3.2",
        "$(EPOCROOT)/epoc32/build/retry_3.3"
    ]
    t.antitargets = [
        "$(EPOCROOT)/epoc32/build/retry_1.2",
        "$(EPOCROOT)/epoc32/build/retry_1.3",
        "$(EPOCROOT)/epoc32/build/retry_2.3",
        "$(EPOCROOT)/epoc32/build/retry_3.ok"
    ]
    t.errors = 1  # make fails! must be an error
    t.returncode = 1
    t.run()
    return t
Exemplo n.º 2
0
def run():
	t = AntiTargetSmokeTest()
	t.name = "retry"
	#
	# -t 3 means try each recipe up to 3 times, if it fails.
	#
	# There are 3 FLM calls: 
	#    retry_1 fails once then succeeds.
	#    retry_2 fails twice then succeeds.
	#    retry_3 fails all 3 times.
	#
	# use -k in case the retry_3 case happens to be run first.
	#
	t.command = "sbs -b smoke_suite/test_resources/retry/bld.inf -c armv5_urel -t 3 -k"
	t.targets = [
		"$(EPOCROOT)/epoc32/build/retry_1.1",
		"$(EPOCROOT)/epoc32/build/retry_1.ok",
		"$(EPOCROOT)/epoc32/build/retry_2.1",
		"$(EPOCROOT)/epoc32/build/retry_2.2",
		"$(EPOCROOT)/epoc32/build/retry_2.ok",
		"$(EPOCROOT)/epoc32/build/retry_3.1",
		"$(EPOCROOT)/epoc32/build/retry_3.2",
		"$(EPOCROOT)/epoc32/build/retry_3.3"
	]
	t.antitargets = [
		"$(EPOCROOT)/epoc32/build/retry_1.2",
		"$(EPOCROOT)/epoc32/build/retry_1.3",
		"$(EPOCROOT)/epoc32/build/retry_2.3",
		"$(EPOCROOT)/epoc32/build/retry_3.ok"
	]
	t.errors = 1 # make fails! must be an error
	t.returncode = 1
	t.run()
	return t
Exemplo n.º 3
0
def run():
	t = AntiTargetSmokeTest()
	t.usebash = True
	
	genericTargets = [
		"$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe",
		"$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe.map",
		"$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe",
		"$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe.map",
		"$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe",
		"$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe.map",
		"$(EPOCROOT)/epoc32/release/winscw/udeb/dependency.exe",
		"$(EPOCROOT)/epoc32/include/dependency.rsg",
		"$(EPOCROOT)/epoc32/data/z/resource/apps/dependency.rsc",
		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/dependency.rsc",
		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/dependency.rsc",
		"$(EPOCROOT)/epoc32/include/main.rsg",
		"$(EPOCROOT)/epoc32/data/z/resource/apps/main.rsc",
		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/main.rsc",
		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/main.rsc"
		]
	windowsTargets = [
		"$(EPOCROOT)/epoc32/release/tools2/rel/dependency.exe",
		"$(EPOCROOT)/epoc32/tools/dependency.exe"
	]
	linuxTargets = [
		"$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM32_DIR)/rel/dependency",
		"$(EPOCROOT)/epoc32/tools/dependency"
	]

	# Set general host platform specifics from first test run, but assume Windows initially
	hostPlatform = "windows"
	hostPlatformTargets = genericTargets + windowsTargets
	hostPlatformOffset = ""

	t.name = "baseline_build"
	t.description = "Build a component with source and resource files that are dependent on header files exported in the build"
	t.command = """
		cp smoke_suite/test_resources/dependencies/src/dependency1.cpp smoke_suite/test_resources/dependencies/dependency.cpp
		cp smoke_suite/test_resources/dependencies/src/dependency1.rss smoke_suite/test_resources/dependencies/dependency.rss
		sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""		
	t.mustnotmatch = [
		"<warning>Missing dependency detected: .*</warning>"
	]
	t.targets = hostPlatformTargets
	t.run(hostPlatform)
	if t.result == AntiTargetSmokeTest.SKIP:
		hostPlatform = "linux"
		hostPlatformTargets = genericTargets + linuxTargets
		hostPlatformOffset = "$(HOSTPLATFORM32_DIR)/"
		t.targets = hostPlatformTargets
		t.run(hostPlatform)
	
	# Ensure we don't clean up from the previous build in the following two tests
	t.targets = []
	
	# Core expected outcome for the following two tests
	t.mustmatch = [
		".*recipe name='compile' target='.*dependency\.o'",
		".*recipe name='win32compile2object' target='.*dependency\.o'",
		".*recipe name='compile2object' target='.*dependency\.o'",
		".*recipe name='resourcecompile' target='.*dependency\.rsc'"
	]
	t.countmatch = [
		[".*recipe name='compile'", 2],
		[".*recipe name='win32compile2object'", 2],
		[".*recipe name='compile2object'", 1],
		[".*recipe name='resourcecompile", 2]
	]

	
	t.name ="touched_header_dependencies"
	t.description = "Touch the exported header files and check that only the related source and resource files are re-built"
	t.command = """
		sleep 1
		touch $(EPOCROOT)/epoc32/include/dependency.h
		touch $(EPOCROOT)/epoc32/include/dependency.rh
		sbs -f- -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
	t.run()

	
	t.name ="redundant_header_dependencies"
	t.description = """
		Build the component again, but manipulate it so that (a) it no longer has a dependency on the exported header files and
		(b) the header files have been removed and (c) the header files are no longer exported.  Check that only the related source
		and resource files are re-built"""
	t.command = """
		cp smoke_suite/test_resources/dependencies/src/dependency2.cpp smoke_suite/test_resources/dependencies/dependency.cpp
		cp smoke_suite/test_resources/dependencies/src/dependency2.rss smoke_suite/test_resources/dependencies/dependency.rss
		rm -rf $(EPOCROOT)/epoc32/include/dependency.h
		rm -rf $(EPOCROOT)/epoc32/include/dependency.rh
		sbs -f- --noexport -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
	t.mustnotmatch = []
	# Note that the resource build does not exhibit a missing dependency as its dependency files are generated in a separate stage where
	# the target file isn't actually a target of that stage
	t.mustmatch.extend([
		"<warning>Missing dependency detected: .*/epoc32/include/dependency.h</warning>"
		])
	t.warnings = 1
	t.run()
	

	t.name ="invalid_dependency_files"
	t.description = "Invalidate dependency files, then make sure we can clean and re-build successfully"
	buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
        # use one long bash command so that we can capture 
	# the output in a way that isn't messed up with all the ordering confused.
	t.command = " echo \"making directory for logfile ${{SBSLOGFILE}}\" ; mkdir -p `dirname ${{SBSLOGFILE}} 2>/dev/null` ; {{ sleep 1 ; set -x ; \
touch smoke_suite/test_resources/dependencies/dependency.cpp; \
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> {0}/armv5/urel/dependency.o.d ; \
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> {0}/winscw/urel/dependency.o.d ;\
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> {0}/dependency_exe/tools2/rel/{1}/dependency.o.d ;\
echo INVALIDATE_RESOURCE_DEPENDENCY_FILE >> {0}/dependency__resource_apps.rsc.d ;\
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel ;\
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel clean ;\
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel ; }} > ${{SBSLOGFILE}} 2>&1; grep 'missing separator' ${{SBSLOGFILE}} ".format(buildLocation, hostPlatformOffset)
	# We expect an error from the first build due to the deliberate dependency file corruption
	t.mustmatch = [
		".*dependency.o.d:[0-9]+: \*\*\* missing separator"
		]
	t.countmatch = []
	t.warnings = 0
	t.errors = 0 
	t.targets = hostPlatformTargets
	t.run(hostPlatform)


	t.name ="no_depend_include"
	t.description = "Invalidate dependency files in order to confirm they aren't processed when --no-depend-include is used"
	buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
	t.command = """
		sleep 1
		touch smoke_suite/test_resources/dependencies/dependency.cpp
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
		sbs --no-depend-include -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
	t.mustmatch = []
	t.errors = 0		
	t.targets = hostPlatformTargets
	t.run(hostPlatform)


	t.name ="no_depend_generate"
	t.description = "Invalidate and remove dependency files in order to confirm they are neither included nor re-generated when --no-depend-generate is used"
	buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment('smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
	t.command = """
		sleep 1
		touch smoke_suite/test_resources/dependencies/dependency.cpp
		touch smoke_suite/test_resources/dependencies/main.cpp
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """+buildLocation+"""/armv5/urel/dependency.o.d
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """+buildLocation+"""/winscw/urel/dependency.o.d
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """+buildLocation+"""/dependency_exe/tools2/rel/"""+hostPlatformOffset+"""dependency.o.d
		sbs --no-depend-generate -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
	t.antitargets = [
		buildLocation+"/armv5/urel/main.o.d",
		buildLocation+"/armv5/udeb/main.o.d",
		buildLocation+"/winscw/urel/main.o.d",
		buildLocation+"/winscw/udeb/main.o.d",
		buildLocation+"/dependency_exe/tools2/rel/"+hostPlatformOffset+"main.o.d"
		]
	t.targets = hostPlatformTargets
	t.run(hostPlatform)
	
	# clean-up
	os.remove("smoke_suite/test_resources/dependencies/dependency.cpp")
	os.remove("smoke_suite/test_resources/dependencies/dependency.rss")

	t.name = "dependencies"
	t.print_result()
	return t
def run():
    t = AntiTargetSmokeTest()
    t.name = "delete_on_failed_compile"
    t.description = "Test that object files are not present following a forced failed compile."

    t.usebash = True
    base_command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5 -k"

    # Ensure everything is reallyclean before the test
    t.name = "delete_on_failed_compile_reallyclean_01"
    t.returncode = 0
    t.antitargets = []
    t.command = base_command + " reallyclean"
    t.run()

    # Object files should *not* be present after this forced failed compile
    t.name = "delete_on_failed_compile_build"
    t.errors = 1
    t.returncode = 1
    # None of these files should be present
    t.addbuildantitargets('smoke_suite/test_resources/simple/bld.inf', [
        "test_/armv5/udeb/test.o", "test_/armv5/udeb/test1.o",
        "test_/armv5/udeb/test2.o", "test_/armv5/udeb/test3.o",
        "test_/armv5/udeb/test4.o", "test_/armv5/udeb/test5.o",
        "test_/armv5/udeb/test6.o", "test_/armv5/urel/test.o",
        "test_/armv5/urel/test1.o", "test_/armv5/urel/test2.o",
        "test_/armv5/urel/test3.o", "test_/armv5/urel/test4.o",
        "test_/armv5/urel/test5.o", "test_/armv5/urel/test6.o"
    ])
    sbshome = os.environ["SBS_HOME"].replace("\\", "/").rstrip("/")
    t.command = base_command.replace("armv5", "armv5.fake_compiler") + \
    " --configpath={0}/test/smoke_suite/test_resources/simple/compilervariants".format(sbshome)
    t.run()

    t.name = "delete_on_failed_compile_reallyclean_02"
    t.errors = 0
    t.returncode = 0
    t.antitargets = []  # Remove the list of anti-targets
    t.command = base_command + " reallyclean"
    t.run()

    # Use a redefined make_engine variant - object files *should* be present
    t.name = "delete_on_failed_compile_build_redefined_make_engine"
    t.errors = 1
    t.returncode = 1
    t.antitargets = []  # Remove the list of anti-targets
    # All of these files should be present
    t.addbuildtargets('smoke_suite/test_resources/simple/bld.inf', [
        "test_/armv5/udeb/test.o", "test_/armv5/udeb/test1.o",
        "test_/armv5/udeb/test2.o", "test_/armv5/udeb/test3.o",
        "test_/armv5/udeb/test4.o", "test_/armv5/udeb/test5.o",
        "test_/armv5/udeb/test6.o", "test_/armv5/urel/test.o",
        "test_/armv5/urel/test1.o", "test_/armv5/urel/test2.o",
        "test_/armv5/urel/test3.o", "test_/armv5/urel/test4.o",
        "test_/armv5/urel/test5.o", "test_/armv5/urel/test6.o"
    ])

    t.command = base_command.replace("armv5", "armv5.fake_compiler") + " -e make_test " \
    + " --configpath={0}/test/smoke_suite/test_resources/simple/compilervariants ".format(sbshome) \
    + " --configpath={0}/test/smoke_suite/test_resources/simple/makevariants".format(sbshome)
    t.run()

    t.name = "delete_on_failed_compile_reallyclean_03"
    t.errors = 0
    t.returncode = 0
    t.antitargets = []  # Remove the list of anti-targets
    t.targets = []  # Remove the list of targets
    t.command = base_command + " reallyclean"
    t.run()

    t.name = "delete_on_failed_compile"
    t.print_result()
    return t
Exemplo n.º 5
0
def run():
	
	# This .inf file is created for clean_simple_export and
	# reallyclean_simple_export tests to use so that we can put the
	# username into the output filenames - which helps a lot when
	# several people run tests on the same computer (e.g. linux machines)
	bld_inf = open('smoke_suite/test_resources/simple_export/expbld.inf', 'w')
	user = os.environ['USER']
	bld_inf.write("""
	
PRJ_PLATFORMS
ARMV5 WINSCW

PRJ_MMPFILES
simple.mmp

PRJ_EXPORTS
#if !defined( WINSCW )
// Exports conditional on build configuration macros aren't actually supported,
// but we confirm that we preprocess in the context of an armv5 build when both
// winscw and armv5 configurations are (implicitly, as there's no "-c" argument)
// used.  This is in order to work around assumptions currently made in the
// source base.
simple_exp1.h exported_1.h
#endif
simple_exp2.h exported_2.h
simple_exp3.h exported_3.h
executable_file executable_file
"file with a space.doc" "exportedfilewithspacesremoved.doc"
"file with a space.doc" "exported file with a space.doc"

simple_exp1.h /tmp/{username}/  //
simple_exp2.h \\tmp\\{username}/  //
simple_exp3.h /tmp/{username}/simple_exp3.h 
simple_exp4.h //
read_only.h was_read_only.h //

// Extended format exports: support for filename wildcards and whole directory copying
:xexport xexport/dir1                                           xexport1
:xexport[invalid_arg=cobblers] xexport/dir1/dir2                +/xexport2
:xexport[recursive=true] xexport/dir1/dir2                      xexport3
:xexport[match="*1dir?.txt"] xexport/dir1/dir2                  +/xexport4
:xexport[match="*1dir?.txt" recursive=true] xexport/dir1/dir2   xexport5/subdir

""".format(username=user))
	bld_inf.close()
	
	exported_files = [
		"$(EPOCROOT)/epoc32/include/exported_1.h",
		"$(EPOCROOT)/epoc32/include/exported_2.h",
		"$(EPOCROOT)/epoc32/include/exported_3.h",
		"$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc",
		"$(EPOCROOT)/epoc32/include/exported file with a space.doc",
		"/tmp/$(USER)/simple_exp1.h",
		"/tmp/$(USER)/simple_exp2.h",
		"/tmp/$(USER)/simple_exp3.h",
		"$(EPOCROOT)/epoc32/include/executable_file",
		"$(EPOCROOT)/epoc32/include/simple_exp4.h",
		"$(EPOCROOT)/epoc32/include/was_read_only.h",
		"$(EPOCROOT)/epoc32/include/xexport1/file1dir1.txt",
		"$(EPOCROOT)/epoc32/include/xexport1/file2dir1.txt",
		"$(EPOCROOT)/epoc32/xexport2/file1dir2.txt",
		"$(EPOCROOT)/epoc32/xexport2/file2dir2.txt",
		"$(EPOCROOT)/epoc32/include/xexport3/file1dir2.txt",
		"$(EPOCROOT)/epoc32/include/xexport3/file2dir2.txt",
		"$(EPOCROOT)/epoc32/include/xexport3/dir3/file1dir3.txt",
		"$(EPOCROOT)/epoc32/include/xexport3/dir3/file2dir3.txt",
		"$(EPOCROOT)/epoc32/xexport4/file1dir2.txt",
		"$(EPOCROOT)/epoc32/include/xexport5/subdir/file1dir2.txt",
		"$(EPOCROOT)/epoc32/include/xexport5/subdir/dir3/file1dir3.txt"
		]
	
	warning_match = ".*warning: Unrecognised ':xexport' argument 'invalid_arg=cobblers' ignored.*"

	t = AntiTargetSmokeTest()
	
	# Check basic export success
	t.name = "export_basic"
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf export"
	t.targets = exported_files
	t.antitargets = []
	t.mustmatch_singleline = [warning_match]
	t.warnings = 1
	t.run()
	
	# Confirm executable permissions are retained on Linux
	t.name = "export_executable_permissions"
	t.usebash = True
	t.command = "ls -l ${EPOCROOT}/epoc32/include/executable_file"
	t.mustmatch = [ "^.rwxrwxr.x[\.\+]? .*executable_file.*$" ]
	t.targets = [] # prevent auto clean-up up of target files from previous test
	t.antitargets = []
	t.mustmatch_singleline = []
	t.warnings = 0
	t.run("linux")

	# Check clean does not delete exports
	t.name = "export_clean"
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf clean"
	t.mustmatch = []
	t.targets = exported_files
	t.antitargets = []
	t.mustmatch_singleline = [warning_match]
	t.warnings = 1
	t.run()

	# Confirm reallyclean deletes all exports, including those that were read-only
	# as source (and so should now be removable at their destination)
	t.name = "export_reallyclean" 
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf reallyclean"
	t.targets = []
	t.antitargets = exported_files
	t.mustmatch_singleline = [warning_match]
	t.warnings = 1
	t.run()

	# Check --noexport suppresses exports
	t.name = "export_noexport" 
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf --noexport -n"
	t.targets = []
	t.antitargets = exported_files
	t.mustmatch_singleline = []
	t.warnings = 0
	t.run()
	
	# Clean all exports in a bld.inf with resources
	t.name = "component_with_resource_reallyclean" 
	t.command = "sbs -b smoke_suite/test_resources/resource/group/simple.inf reallyclean"
	t.targets = []
	t.antitargets = []
	t.mustmatch_singleline = []
	t.warnings = 0
	t.run()

	# Ensure that sbs EXPORT does not generate errors
	t.name = "export_generates_no_errors" 
	t.command = "sbs -b smoke_suite/test_resources/resource/group/simple.inf EXPORT"
	t.targets = [ "$(EPOCROOT)/epoc32/include/testresource_badef.rh",
				  "$(EPOCROOT)/epoc32/include/testresource.hrh"]
	t.antitargets = []
	t.errors = 0
	t.warnings = 0
	t.run()
	
	t.name = "export"
	t.print_result()
	return t
def run():
	t = AntiTargetSmokeTest()
	t.name = "delete_on_failed_compile"
	t.description = "Test that object files are not present following a forced failed compile."
	
	t.usebash = True
	base_command = "sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5 -k"
	
	# Ensure everything is reallyclean before the test
	t.name = "delete_on_failed_compile_reallyclean_01"
	t.returncode = 0
	t.antitargets = [ ]
	t.command = base_command + " reallyclean"
	t.run()
	
	# Object files should *not* be present after this forced failed compile
	t.name = "delete_on_failed_compile_build"
	t.errors = 1
	t.returncode = 1
	# None of these files should be present
	t.addbuildantitargets('smoke_suite/test_resources/simple/bld.inf', 
		[	"test_/armv5/udeb/test.o",
			"test_/armv5/udeb/test1.o",
			"test_/armv5/udeb/test2.o",
			"test_/armv5/udeb/test3.o",
			"test_/armv5/udeb/test4.o",
			"test_/armv5/udeb/test5.o",
			"test_/armv5/udeb/test6.o",
			"test_/armv5/urel/test.o",
			"test_/armv5/urel/test1.o",
			"test_/armv5/urel/test2.o",
			"test_/armv5/urel/test3.o",
			"test_/armv5/urel/test4.o",
			"test_/armv5/urel/test5.o",
			"test_/armv5/urel/test6.o"  ])
	sbshome = os.environ["SBS_HOME"].replace("\\","/").rstrip("/")
	t.command = base_command.replace("armv5", "armv5.fake_compiler") + \
	" --configpath={0}/test/smoke_suite/test_resources/simple/compilervariants".format(sbshome)
	t.run()
	
	t.name = "delete_on_failed_compile_reallyclean_02"
	t.errors = 0
	t.returncode = 0
	t.antitargets = [] # Remove the list of anti-targets
	t.command = base_command + " reallyclean"
	t.run()
	
	# Use a redefined make_engine variant - object files *should* be present
	t.name = "delete_on_failed_compile_build_redefined_make_engine"
	t.errors = 1
	t.returncode = 1
	t.antitargets = [] # Remove the list of anti-targets
	# All of these files should be present
	t.addbuildtargets('smoke_suite/test_resources/simple/bld.inf', 
		[	"test_/armv5/udeb/test.o",
			"test_/armv5/udeb/test1.o",
			"test_/armv5/udeb/test2.o",
			"test_/armv5/udeb/test3.o",
			"test_/armv5/udeb/test4.o",
			"test_/armv5/udeb/test5.o",
			"test_/armv5/udeb/test6.o",
			"test_/armv5/urel/test.o",
			"test_/armv5/urel/test1.o",
			"test_/armv5/urel/test2.o",
			"test_/armv5/urel/test3.o",
			"test_/armv5/urel/test4.o",
			"test_/armv5/urel/test5.o",
			"test_/armv5/urel/test6.o"  ])
	
	t.command = base_command.replace("armv5", "armv5.fake_compiler") + " -e make_test " \
	+ " --configpath={0}/test/smoke_suite/test_resources/simple/compilervariants ".format(sbshome) \
	+ " --configpath={0}/test/smoke_suite/test_resources/simple/makevariants".format(sbshome)
	t.run()
	
	t.name = "delete_on_failed_compile_reallyclean_03"
	t.errors = 0
	t.returncode = 0
	t.antitargets = [] # Remove the list of anti-targets
	t.targets = [] # Remove the list of targets
	t.command = base_command + " reallyclean"
	t.run()
	
	t.name = "delete_on_failed_compile"
	t.print_result()
	return t
Exemplo n.º 7
0
def run():
    t = AntiTargetSmokeTest()
    t.usebash = True

    genericTargets = [
        "$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe",
        "$(EPOCROOT)/epoc32/release/armv5/udeb/dependency.exe.map",
        "$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe",
        "$(EPOCROOT)/epoc32/release/armv5/urel/dependency.exe.map",
        "$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe",
        "$(EPOCROOT)/epoc32/release/winscw/urel/dependency.exe.map",
        "$(EPOCROOT)/epoc32/release/winscw/udeb/dependency.exe",
        "$(EPOCROOT)/epoc32/include/dependency.rsg",
        "$(EPOCROOT)/epoc32/data/z/resource/apps/dependency.rsc",
        "$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/dependency.rsc",
        "$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/dependency.rsc",
        "$(EPOCROOT)/epoc32/include/main.rsg",
        "$(EPOCROOT)/epoc32/data/z/resource/apps/main.rsc",
        "$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/main.rsc",
        "$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/main.rsc"
    ]
    windowsTargets = [
        "$(EPOCROOT)/epoc32/release/tools2/rel/dependency.exe",
        "$(EPOCROOT)/epoc32/tools/dependency.exe"
    ]
    linuxTargets = [
        "$(EPOCROOT)/epoc32/release/tools2/$(HOSTPLATFORM32_DIR)/rel/dependency",
        "$(EPOCROOT)/epoc32/tools/dependency"
    ]

    # Set general host platform specifics from first test run, but assume Windows initially
    hostPlatform = "windows"
    hostPlatformTargets = genericTargets + windowsTargets
    hostPlatformOffset = ""

    t.name = "baseline_build"
    t.description = "Build a component with source and resource files that are dependent on header files exported in the build"
    t.command = """
		cp smoke_suite/test_resources/dependencies/src/dependency1.cpp smoke_suite/test_resources/dependencies/dependency.cpp
		cp smoke_suite/test_resources/dependencies/src/dependency1.rss smoke_suite/test_resources/dependencies/dependency.rss
		sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
    t.mustnotmatch = ["<warning>Missing dependency detected: .*</warning>"]
    t.targets = hostPlatformTargets
    t.run(hostPlatform)
    if t.result == AntiTargetSmokeTest.SKIP:
        hostPlatform = "linux"
        hostPlatformTargets = genericTargets + linuxTargets
        hostPlatformOffset = "$(HOSTPLATFORM32_DIR)/"
        t.targets = hostPlatformTargets
        t.run(hostPlatform)

    # Ensure we don't clean up from the previous build in the following two tests
    t.targets = []

    # Core expected outcome for the following two tests
    t.mustmatch = [
        ".*recipe name='compile' target='.*dependency\.o'",
        ".*recipe name='win32compile2object' target='.*dependency\.o'",
        ".*recipe name='compile2object' target='.*dependency\.o'",
        ".*recipe name='resourcecompile' target='.*dependency\.rsc'"
    ]
    t.countmatch = [[".*recipe name='compile'", 2],
                    [".*recipe name='win32compile2object'", 2],
                    [".*recipe name='compile2object'", 1],
                    [".*recipe name='resourcecompile", 2]]

    t.name = "touched_header_dependencies"
    t.description = "Touch the exported header files and check that only the related source and resource files are re-built"
    t.command = """
		sleep 1
		touch $(EPOCROOT)/epoc32/include/dependency.h
		touch $(EPOCROOT)/epoc32/include/dependency.rh
		sbs -f- -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
    t.run()

    t.name = "redundant_header_dependencies"
    t.description = """
		Build the component again, but manipulate it so that (a) it no longer has a dependency on the exported header files and
		(b) the header files have been removed and (c) the header files are no longer exported.  Check that only the related source
		and resource files are re-built"""
    t.command = """
		cp smoke_suite/test_resources/dependencies/src/dependency2.cpp smoke_suite/test_resources/dependencies/dependency.cpp
		cp smoke_suite/test_resources/dependencies/src/dependency2.rss smoke_suite/test_resources/dependencies/dependency.rss
		rm -rf $(EPOCROOT)/epoc32/include/dependency.h
		rm -rf $(EPOCROOT)/epoc32/include/dependency.rh
		sbs -f- --noexport -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
    t.mustnotmatch = []
    # Note that the resource build does not exhibit a missing dependency as its dependency files are generated in a separate stage where
    # the target file isn't actually a target of that stage
    t.mustmatch.extend([
        "<warning>Missing dependency detected: .*/epoc32/include/dependency.h</warning>"
    ])
    t.warnings = 1
    t.run()

    t.name = "invalid_dependency_files"
    t.description = "Invalidate dependency files, then make sure we can clean and re-build successfully"
    buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment(
        'smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
    # use one long bash command so that we can capture
    # the output in a way that isn't messed up with all the ordering confused.
    t.command = " echo \"making directory for logfile ${{SBSLOGFILE}}\" ; mkdir -p `dirname ${{SBSLOGFILE}} 2>/dev/null` ; {{ sleep 1 ; set -x ; \
touch smoke_suite/test_resources/dependencies/dependency.cpp; \
echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> {0}/armv5/urel/dependency.o.d ; \
echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> {0}/winscw/urel/dependency.o.d ;\
echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> {0}/dependency_exe/tools2/rel/{1}/dependency.o.d ;\
echo INVALIDATE_RESOURCE_DEPENDENCY_FILE >> {0}/dependency__resource_apps.rsc.d ;\
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel ;\
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel clean ;\
sbs -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel ; }} > ${{SBSLOGFILE}} 2>&1; grep 'missing separator' ${{SBSLOGFILE}} ".format(
        buildLocation, hostPlatformOffset)
    # We expect an error from the first build due to the deliberate dependency file corruption
    t.mustmatch = [".*dependency.o.d:[0-9]+: \*\*\* missing separator"]
    t.countmatch = []
    t.warnings = 0
    t.errors = 0
    t.targets = hostPlatformTargets
    t.run(hostPlatform)

    t.name = "no_depend_include"
    t.description = "Invalidate dependency files in order to confirm they aren't processed when --no-depend-include is used"
    buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment(
        'smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
    t.command = """
		sleep 1
		touch smoke_suite/test_resources/dependencies/dependency.cpp
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """ + buildLocation + """/armv5/urel/dependency.o.d
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """ + buildLocation + """/winscw/urel/dependency.o.d
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """ + buildLocation + """/dependency_exe/tools2/rel/""" + hostPlatformOffset + """dependency.o.d
		sbs --no-depend-include -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
    t.mustmatch = []
    t.errors = 0
    t.targets = hostPlatformTargets
    t.run(hostPlatform)

    t.name = "no_depend_generate"
    t.description = "Invalidate and remove dependency files in order to confirm they are neither included nor re-generated when --no-depend-generate is used"
    buildLocation = "$(EPOCROOT)/epoc32/build/" + BldInfFile.outputPathFragment(
        'smoke_suite/test_resources/dependencies/bld.inf') + "/dependency_"
    t.command = """
		sleep 1
		touch smoke_suite/test_resources/dependencies/dependency.cpp
		touch smoke_suite/test_resources/dependencies/main.cpp
		echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> """ + buildLocation + """/armv5/urel/dependency.o.d
		echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> """ + buildLocation + """/winscw/urel/dependency.o.d
		echo INVALIDATE_TOOLS2_DEPENDENCY_FILE >> """ + buildLocation + """/dependency_exe/tools2/rel/""" + hostPlatformOffset + """dependency.o.d
		sbs --no-depend-generate -b smoke_suite/test_resources/dependencies/bld.inf -c default -c tools2_rel"""
    t.antitargets = [
        buildLocation + "/armv5/urel/main.o.d",
        buildLocation + "/armv5/udeb/main.o.d",
        buildLocation + "/winscw/urel/main.o.d",
        buildLocation + "/winscw/udeb/main.o.d", buildLocation +
        "/dependency_exe/tools2/rel/" + hostPlatformOffset + "main.o.d"
    ]
    t.targets = hostPlatformTargets
    t.run(hostPlatform)

    # clean-up
    os.remove("smoke_suite/test_resources/dependencies/dependency.cpp")
    os.remove("smoke_suite/test_resources/dependencies/dependency.rss")

    t.name = "dependencies"
    t.print_result()
    return t