1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of the License "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # |
|
16 |
|
17 from raptor_tests import SmokeTest |
|
18 from raptor_meta import BldInfFile |
|
19 |
|
20 def run(): |
|
21 result = SmokeTest.PASS |
|
22 |
|
23 t = SmokeTest() |
|
24 t.id = "0098a" |
|
25 t.name = "Build a component to begin with" |
|
26 t.description = "Build a simple component" |
|
27 t.usebash = True |
|
28 t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf" |
|
29 |
|
30 t.targets = [ |
|
31 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe", |
|
32 "$(EPOCROOT)/epoc32/release/armv5/udeb/test.exe.map", |
|
33 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe", |
|
34 "$(EPOCROOT)/epoc32/release/armv5/urel/test.exe.map", |
|
35 "$(EPOCROOT)/epoc32/release/winscw/urel/test.exe", |
|
36 "$(EPOCROOT)/epoc32/release/winscw/udeb/test.exe" |
|
37 ] |
|
38 t.run() |
|
39 if t.result == SmokeTest.FAIL: |
|
40 result = SmokeTest.FAIL |
|
41 |
|
42 # Ensure we don't clean up from the previous build in any subsequent runs |
|
43 t = SmokeTest() |
|
44 t.addbuildtargets('smoke_suite/test_resources/simple/bld.inf', []) |
|
45 t.targets = [] |
|
46 t.usebash = True |
|
47 |
|
48 t.id = "0098b" |
|
49 t.name ="Touch a source file dependency and make sure thats the only one rebuilt" |
|
50 t.description = "Touches one source file's dependency to check if its rebuilt" |
|
51 t.command = """ |
|
52 sleep 1 |
|
53 touch smoke_suite/test_resources/simple/test.h |
|
54 sbs -f - -b smoke_suite/test_resources/simple/bld.inf """ |
|
55 # We should only recompile 1 source file, twice for armv5 and twice for winscw |
|
56 t.countmatch = [ |
|
57 [".*recipe name='compile'.*", 2], |
|
58 [".*recipe name='win32compile2object'.*", 2] |
|
59 ] |
|
60 |
|
61 t.run() |
|
62 if t.result == SmokeTest.FAIL: |
|
63 result = SmokeTest.FAIL |
|
64 |
|
65 # Invalidate the dependency file to make sure its not regenerated |
|
66 t = SmokeTest() |
|
67 # Ensure we don't clean up from the previous build in any subsequent runs |
|
68 t.addbuildtargets('smoke_suite/test_resources/simple/bld.inf', []) |
|
69 t.targets = [] |
|
70 t.usebash = True |
|
71 |
|
72 t.id = "0098c" |
|
73 t.name ="Invalidate the dependency file to make sure its not regenerated" |
|
74 t.description = "Invalidate the dependency file to make sure its not regenerated" |
|
75 fragment = BldInfFile.outputPathFragment('smoke_suite/test_resources/simple/Bld.inf') |
|
76 t.command = """ |
|
77 sleep 1 |
|
78 touch smoke_suite/test_resources/simple/test.cpp |
|
79 echo INVALIDATE_ARMV5_DEPENDENCY_FILE >> $(EPOCROOT)/epoc32/build/"""+ fragment + """/test_/armv5/urel/test.o.d |
|
80 echo INVALIDATE_WINSCW_DEPENDENCY_FILE >> $(EPOCROOT)/epoc32/build/"""+ fragment + """/test_/winscw/urel/test.o.d |
|
81 sbs -b smoke_suite/test_resources/simple/bld.inf -c armv5_urel -c winscw_urel |
|
82 rm -rf $(EPOCROOT)/epoc32/build/"""+ fragment + """/test_/armv5/urel/test.o.d |
|
83 rm -rf $(EPOCROOT)/epoc32/build/"""+ fragment + """/test_/winscw/urel/test.o.d""" |
|
84 t.errors = 1 # We expect the build to fail since we messed up the dependency file |
|
85 t.run() |
|
86 if t.result == SmokeTest.FAIL: |
|
87 result = SmokeTest.FAIL |
|
88 |
|
89 t.id = "98" |
|
90 t.name = "basic_dependency" |
|
91 t.result = result |
|
92 t.print_result() |
|
93 return t |
|