sbsv2/raptor/test/smoke_suite/export.py
author tnmurphy@4GBL06592.nokia.com
Sat, 21 Nov 2009 00:59:51 +0000
branchwip
changeset 14 45cdac6e50c6
parent 3 e1eecf4d390d
child 278 c38bfd29ee57
permissions -rw-r--r--
--noexport option
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     1
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     3
# All rights reserved.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     4
# This component and the accompanying materials are made available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     6
# which accompanies this distribution, and is available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     8
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
     9
# Initial Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    11
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    12
# Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    13
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    14
# Description: 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    15
#
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    16
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    17
from raptor_tests import SmokeTest, AntiTargetSmokeTest
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    18
import os
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    19
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    20
def run():
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    21
	result = SmokeTest.PASS
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    22
	
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    23
	# This .inf file is created for clean_simple_export and
14
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    24
	# reallyclean_simple_export tests to use so that we can put the
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    25
	# username into the output filenames - which helps a lot when
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    26
	# several people run tests on the same computer (e.g. linux machines)
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    27
	bld = open('smoke_suite/test_resources/simple_export/expbld.inf', 'w')
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    28
	bld.write("PRJ_PLATFORMS\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    29
		"ARMV5 WINSCW\n\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    30
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    31
		"PRJ_MMPFILES\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    32
		"simple.mmp\n\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    33
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    34
		"PRJ_EXPORTS\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    35
		"simple_exp1.h exported_1.h\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    36
		"simple_exp2.h exported_2.h\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    37
		"simple_exp3.h exported_3.h\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    38
		'"file with a space.doc" "exportedfilewithspacesremoved.doc"\n'
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    39
		'"file with a space.doc" "exported file with a space.doc"\n\n'
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    40
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    41
		"simple_exp1.h /tmp/"+os.environ['USER']+"/  //\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    42
		"simple_exp2.h \\tmp\\"+os.environ['USER']+"/  //\n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    43
		"simple_exp3.h /tmp/"+os.environ['USER']+"/simple_exp3.h \n"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    44
		"simple_exp4.h //")
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    45
	bld.close()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    46
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    47
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    48
	t = SmokeTest()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    49
	t.id = "0023a"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    50
	t.name = "export"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    51
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf " \
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    52
			+ "-c armv5 EXPORT"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    53
	t.targets = [
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    54
		"$(EPOCROOT)/epoc32/include/exported_1.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    55
		"$(EPOCROOT)/epoc32/include/exported_2.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    56
		"$(EPOCROOT)/epoc32/include/exported_3.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    57
		"$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    58
		"$(EPOCROOT)/epoc32/include/exported file with a space.doc",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    59
		"/tmp/$(USER)/simple_exp1.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    60
		"/tmp/$(USER)/simple_exp2.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    61
		"/tmp/$(USER)/simple_exp3.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    62
		"$(EPOCROOT)/epoc32/include/simple_exp4.h"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    63
		]
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    64
	t.run()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    65
	if t.result == SmokeTest.FAIL:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    66
		result = SmokeTest.FAIL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    67
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    68
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    69
	# Testing if clean deletes any exports which it is not supposed to
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    70
	t.id = "0023b"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    71
	t.name = "export_clean" 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    72
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf " \
14
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    73
			+ "-c armv5 clean"
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    74
	t.targets = [
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    75
		"$(EPOCROOT)/epoc32/include/exported_1.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    76
		"$(EPOCROOT)/epoc32/include/exported_2.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    77
		"$(EPOCROOT)/epoc32/include/exported_3.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    78
		"$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    79
		"$(EPOCROOT)/epoc32/include/exported file with a space.doc",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    80
		"/tmp/$(USER)/simple_exp1.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    81
		"/tmp/$(USER)/simple_exp2.h",
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    82
		"/tmp/$(USER)/simple_exp3.h"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    83
		]
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    84
	t.run()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    85
	if t.result == SmokeTest.FAIL:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    86
		result = SmokeTest.FAIL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    87
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    88
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    89
	t = AntiTargetSmokeTest()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    90
	t.id = "0023c"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    91
	t.name = "export_reallyclean" 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
    92
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf " \
14
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    93
			+ "-c armv5 reallyclean"
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    94
	t.antitargets = [
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    95
		'$(EPOCROOT)/epoc32/include/exported_1.h',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    96
		'$(EPOCROOT)/epoc32/include/exported_2.h',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    97
		'$(EPOCROOT)/epoc32/include/exported_3.h',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    98
		'$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
    99
		'$(EPOCROOT)/epoc32/include/exported file with a space.doc',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   100
		'/tmp/$(USER)/simple_exp1.h',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   101
		'/tmp/$(USER)/simple_exp2.h',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   102
		'/tmp/$(USER)/simple_exp3.h',
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   103
		'$(EPOCROOT)/epoc32/include/simple_exp4.h'
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   104
	]
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   105
	t.run()
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   106
	if t.result == SmokeTest.FAIL:
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   107
		result = SmokeTest.FAIL
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   108
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   109
	# Check that the --noexport feature really does prevent exports from happening
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   110
	t = AntiTargetSmokeTest()
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   111
	t.id = "0023d"
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   112
	t.name = "export_noexport" 
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   113
	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf " \
45cdac6e50c6 --noexport option
tnmurphy@4GBL06592.nokia.com
parents: 3
diff changeset
   114
			+ "-c armv5 --noexport -n"
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   115
	t.antitargets = [
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   116
		'$(EPOCROOT)/epoc32/include/exported_1.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   117
		'$(EPOCROOT)/epoc32/include/exported_2.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   118
		'$(EPOCROOT)/epoc32/include/exported_3.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   119
		'$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   120
		'$(EPOCROOT)/epoc32/include/exported file with a space.doc',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   121
		'/tmp/$(USER)/simple_exp1.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   122
		'/tmp/$(USER)/simple_exp2.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   123
		'/tmp/$(USER)/simple_exp3.h',
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   124
		'$(EPOCROOT)/epoc32/include/simple_exp4.h'
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   125
	]
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   126
	t.run()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   127
	if t.result == SmokeTest.FAIL:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   128
		result = SmokeTest.FAIL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   129
		
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   130
	t.id = "23"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   131
	t.name = "export"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   132
	t.result = result
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   133
	t.print_result()
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents:
diff changeset
   134
	return t