sbsv2/raptor/test/smoke_suite/featurevariants.py
changeset 641 8dd670a9f34f
parent 625 a1925fb7753a
equal deleted inserted replaced
640:ac0bbc1e5d79 641:8dd670a9f34f
     1 #
     1 
     2 # Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 # Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     3 # All rights reserved.
     4 # This component and the accompanying materials are made available
     4 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     5 # under the terms of the License "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     6 # which accompanies this distribution, and is available
    13 #
    13 #
    14 # Description: 
    14 # Description: 
    15 #
    15 #
    16 
    16 
    17 from raptor_tests import AntiTargetSmokeTest, ReplaceEnvs
    17 from raptor_tests import AntiTargetSmokeTest, ReplaceEnvs
       
    18 from raptor_meta import BldInfFile
    18 import os
    19 import os
    19 
    20 
    20 def run():
    21 def run():
    21 	t = AntiTargetSmokeTest()
    22 	t = AntiTargetSmokeTest()
    22 	t.usebash = True
    23 	t.usebash = True
       
    24 
       
    25 	# create some empty source files just to test createvmaps command file handling:
       
    26 	test_cpp_files = []
       
    27 	for i in xrange(0,16):
       
    28 		tf = "smoke_suite/test_resources/bv/variant1/test_createvmap{0:02}.cpp".format(i)
       
    29 		f = open(tf,"w+")
       
    30 		f.close()
       
    31 		test_cpp_files.append(tf)
    23 	
    32 	
    24 	preBuiltTargets = [
    33 	preBuiltTargets = [
    25 		"$(EPOCROOT)/epoc32/release/armv5/udeb/dummy.lib",
    34 		"$(EPOCROOT)/epoc32/release/armv5/udeb/dummy.lib",
    26 		"$(EPOCROOT)/epoc32/release/armv5/urel/dummy.lib",
    35 		"$(EPOCROOT)/epoc32/release/armv5/urel/dummy.lib",
    27 		"$(EPOCROOT)/epoc32/release/armv5/udeb/debfake.lib",
    36 		"$(EPOCROOT)/epoc32/release/armv5/udeb/debfake.lib",
   298 		"dummy_var2_dll/dummy_var2_dummy.rsc.d",
   307 		"dummy_var2_dll/dummy_var2_dummy.rsc.d",
   299 		"dummy_var3_exe/dummy_var3_dummy.rsc.rpp",
   308 		"dummy_var3_exe/dummy_var3_dummy.rsc.rpp",
   300 		"dummy_var3_exe/dummy_var3_dummy.rsc.d"
   309 		"dummy_var3_exe/dummy_var3_dummy.rsc.d"
   301 		]
   310 		]
   302 	
   311 	
   303 	sbscommand = "sbs -b smoke_suite/test_resources/bv/bld.inf -c armv5 " + \
   312 	bldinf = 'smoke_suite/test_resources/bv/bld.inf'
   304 				"-c armv5.test_bv_1 -c armv5.test_bv_2 -c armv5.test_bv_3 -f- " + \
   313 	sbscommand = "sbs -b {0} -c armv5 -c armv5.test_bv_1 -c armv5.test_bv_2 -c armv5.test_bv_3 -f- --configpath=test/smoke_suite/test_resources/bv/config/variants".format(bldinf)
   305 				"--configpath=test/smoke_suite/test_resources/bv/config/variants"
       
   306 	
   314 	
   307 	t.id = "56a"
   315 	t.id = "56a"
   308 	t.description = """Build variant and invariant components.
   316 	t.description = """Build variant and invariant components.
   309 		In this default mode of operation, all components build for the non-product armv5 config whereas
   317 		In this default mode of operation, all components build for the non-product armv5 config whereas
   310 		only variant components build for the armv5.* bv configs."""
   318 		only variant components build for the armv5.* bv configs."""
   311 	t.name = "featurevariant_build"
   319 	t.name = "featurevariant_build"
   312 	t.command = sbscommand
   320 
       
   321 	t.command = "{0} && cat $(EPOCROOT)/epoc32/build/{1}/{2}".format(sbscommand, BldInfFile.outputPathFragment(bldinf), "createstaticdll_variant1_dll/armv5.three/udeb/createstaticdll_variant1.vmap.cmdfile")
   313 	t.targets = preBuiltTargets + invariantTargets + variantTargetsGeneric + variantTargetsDefaultTree + variantTargetsProductTrees							
   322 	t.targets = preBuiltTargets + invariantTargets + variantTargetsGeneric + variantTargetsDefaultTree + variantTargetsProductTrees							
   314 	t.addbuildtargets('smoke_suite/test_resources/bv/bld.inf',
   323 	t.addbuildtargets(bldinf,
   315 				invariantBuildTargets + variantBuildTargetsGeneric + variantBuildTargetsDefaultTree + variantBuildTargetsProductTrees	
   324 				invariantBuildTargets + variantBuildTargetsGeneric + variantBuildTargetsDefaultTree + variantBuildTargetsProductTrees	
   316 				)
   325 				)
       
   326 	
   317 	# Test that static libs are linked from the invariant place.
   327 	# Test that static libs are linked from the invariant place.
   318 	t.mustmatch = [
   328 	t.mustmatch = [
   319 		"armlink.*epoc32/release/armv5/urel/bv_static_lib.lib",
   329 		"armlink.*epoc32/release/armv5/urel/bv_static_lib.lib",
   320 		"armlink.*epoc32/release/armv5/udeb/bv_static_lib.lib"
   330 		"armlink.*epoc32/release/armv5/udeb/bv_static_lib.lib",
   321 		]
   331 		"\s*-s.*variant1/CreateStaticDLL_variant1.cpp",
   322 	t.run()
   332 		"\s*-s.*variant1/test_createvmap01.cpp",
       
   333 		"\s*-s.*variant1/test_createvmap02.cpp",
       
   334 		"\s*-s.*variant1/test_createvmap03.cpp",
       
   335 		"\s*-s.*variant1/test_createvmap04.cpp",
       
   336 		"\s*-s.*variant1/test_createvmap05.cpp",
       
   337 		"\s*-s.*variant1/test_createvmap06.cpp",
       
   338 		"\s*-s.*variant1/test_createvmap07.cpp",
       
   339 		"\s*-s.*variant1/test_createvmap08.cpp",
       
   340 		"\s*-s.*variant1/test_createvmap09.cpp",
       
   341 		"\s*-s.*variant1/test_createvmap10.cpp",
       
   342 		"\s*-s.*variant1/test_createvmap11.cpp",
       
   343 		"\s*-s.*variant1/test_createvmap12.cpp",
       
   344 		"\s*-s.*variant1/test_createvmap13.cpp",
       
   345 		"\s*-s.*variant1/test_createvmap14.cpp",
       
   346 		"\s*-s.*variant1/test_createvmap15.cpp",
       
   347 		"\s*-s.*variant1/CreateStaticDLL_variant1.mmp"
       
   348 		]
       
   349 	t.run()
       
   350 
       
   351 
   323 	
   352 	
   324 	t.id = "56b"
   353 	t.id = "56b"
   325 	t.description = """Build variant and invariant components using an os_properties.xml that sets FEATUREVARIANTSAFE=1.
   354 	t.description = """Build variant and invariant components using an os_properties.xml that sets FEATUREVARIANTSAFE=1.
   326 		With FEATUREVARIANTSAFE only invariant components build for the non-product armv5 config and
   355 		With FEATUREVARIANTSAFE only invariant components build for the non-product armv5 config and
   327 		only variant components build for the armv5.* bv configs.""" 
   356 		only variant components build for the armv5.* bv configs.""" 
   340 		"armlink.*epoc32/release/armv5/urel/bv_static_lib.lib",
   369 		"armlink.*epoc32/release/armv5/urel/bv_static_lib.lib",
   341 		"armlink.*epoc32/release/armv5/udeb/bv_static_lib.lib"
   370 		"armlink.*epoc32/release/armv5/udeb/bv_static_lib.lib"
   342 		]
   371 		]
   343 	t.run()
   372 	t.run()
   344 
   373 
       
   374 
   345 	
   375 	
   346 	# tests for the createvmap script
   376 	# tests for the createvmap script
   347 	createvmap = "python $(SBS_HOME)/bin/createvmap.py"
   377 	createvmap = "python $(SBS_HOME)/bin/createvmap.py"
   348 	vmapfile = "$(EPOCROOT)/epoc32/build/test.vmap"
   378 	vmapfile = "$(EPOCROOT)/epoc32/build/test.vmap"
   349 	vmap = " -o " + vmapfile
   379 	vmap = " -o " + vmapfile
   411 	t.command = createvmap + vmap + bvcpp + preinc + listA + listB + srcWith + srcWithout + " && cat " + vmapfile
   441 	t.command = createvmap + vmap + bvcpp + preinc + listA + listB + srcWith + srcWithout + " && cat " + vmapfile
   412 	t.returncode = 0
   442 	t.returncode = 0
   413 	t.targets = [vmapfile]
   443 	t.targets = [vmapfile]
   414 	t.mustmatch = ["A_1=defined", "B_1000=undefined"]
   444 	t.mustmatch = ["A_1=defined", "B_1000=undefined"]
   415 	t.run()
   445 	t.run()
       
   446 
       
   447 
       
   448 	# clean up test cpp files from the first test (do it noow after they are no longer needed)
       
   449 	for tf in test_cpp_files:
       
   450 		os.unlink(tf)
   416 	
   451 	
   417 	
   452 	
   418 	# print the overall result
   453 	# print the overall result
   419 	t.id = "56"
   454 	t.id = "56"
   420 	t.name = "featurevariants"
   455 	t.name = "featurevariants"