author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 04 Aug 2017 12:09:09 +0100 | |
branch | jv |
changeset 1952 | 2a5f8c52b7a1 |
parent 1612 | 972b34959a7b |
child 1960 | 66ad86b6ada2 |
permissions | -rw-r--r-- |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
1008 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#MakefileTests |
|
6 |
instanceVariableNames:'package packageDir' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'tests-Regression' |
|
10 |
! |
|
11 |
||
12 |
StandaloneStartup subclass:#TestApplication01 |
|
13 |
instanceVariableNames:'' |
|
14 |
classVariableNames:'' |
|
15 |
poolDictionaries:'' |
|
16 |
privateIn:MakefileTests |
|
17 |
! |
|
18 |
||
19 |
!MakefileTests class methodsFor:'documentation'! |
|
20 |
||
21 |
documentation |
|
22 |
" |
|
1447 | 23 |
This testcase tests St/X makefiles used to build |
1008 | 24 |
standalone applications. |
25 |
||
26 |
[author:] |
|
1447 | 27 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
1008 | 28 |
|
29 |
[instance variables:] |
|
30 |
||
31 |
[class variables:] |
|
32 |
||
33 |
[see also:] |
|
34 |
||
35 |
" |
|
36 |
! ! |
|
37 |
||
38 |
!MakefileTests methodsFor:'compilation'! |
|
39 |
||
40 |
make |
|
41 |
^ self make:''. |
|
42 |
||
43 |
"Created: / 14-08-2013 / 18:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
44 |
! |
|
45 |
||
46 |
make: target |
|
1612
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
47 |
| cmd output success | |
1008 | 48 |
|
1612
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
49 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
50 |
"/ Hack: generally we don't require Borland tools to be installed anymore. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
51 |
"/ However, package build is driwen by Borland make so we distribute |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
52 |
"/ it with rakefiles. It's likely not in the PATH, so add it. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
53 |
"/ This code assumes the test is run from build environment. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
54 |
OperatingSystem setEnvironment: 'PATH' to: |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
55 |
(OperatingSystem pathOfSTXExecutable asFilename directory / '..' / '..' / '..' / '..' / 'bin') pathName , ';', |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
56 |
(OperatingSystem getEnvironment: 'PATH'). |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
57 |
|
1541
5c6a32e00528
Fixed `MakefileTests` and `SnapshotRestartTests` to not call obsolete method OperatingSystem>>getCCDefine
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
58 |
STCCompilerInterface getCCDefine = '__BORLANDC__' ifTrue:[ |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
59 |
cmd := 'bmake.bat ' , target. |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
60 |
]. |
1541
5c6a32e00528
Fixed `MakefileTests` and `SnapshotRestartTests` to not call obsolete method OperatingSystem>>getCCDefine
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
61 |
STCCompilerInterface getCCDefine = '__MINGW32__' ifTrue:[ |
1543
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
62 |
(OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
63 |
| mingwDir | |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
64 |
|
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
65 |
mingwDir := #('C:\MSYS64\MINGW32' 'C:\MINGW') detect:[:path | path asFilename isDirectory ] ifNone: [ nil ]. |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
66 |
self assert: mingwDir notNil description: 'MINGW_DIR environment variable not set and MINGW32 not found at standard places'. |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
67 |
OperatingSystem setEnvironment: 'MINGW_DIR' to: mingwDir. |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
68 |
]. |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
69 |
OperatingSystem setEnvironment: 'MINGW' to: '__MINGW32__'. |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
70 |
OperatingSystem setEnvironment: 'USEMINGW_ARG' to: '-DUSEMINGW32'. |
1543
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
71 |
OperatingSystem setEnvironment: 'PATH' to: (OperatingSystem getEnvironment: 'PATH') , ';' , (OperatingSystem getEnvironment: 'MINGW_DIR') , '\bin'. |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
72 |
cmd := 'mingwmake.bat ' , target. |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
73 |
]. |
1541
5c6a32e00528
Fixed `MakefileTests` and `SnapshotRestartTests` to not call obsolete method OperatingSystem>>getCCDefine
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
74 |
STCCompilerInterface getCCDefine = '__MINGW64__' ifTrue:[ |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
75 |
(OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ |
1543
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
76 |
| mingwDir | |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
77 |
|
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
78 |
mingwDir := #('C:\MSYS64\MINGW64' 'C:\MINGW64') detect:[:path | path asFilename isDirectory ] ifNone: [ nil ]. |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
79 |
self assert: mingwDir notNil description: 'MINGW_DIR environment variable not set and MINGW64 not found at standard places'. |
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
80 |
OperatingSystem setEnvironment: 'MINGW_DIR' to: mingwDir. |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
81 |
]. |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
82 |
OperatingSystem setEnvironment: 'MINGW' to: '__MINGW64__'. |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
83 |
OperatingSystem setEnvironment: 'USEMINGW_ARG' to: '-DUSEMINGW64'. |
1543
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
84 |
OperatingSystem setEnvironment: 'PATH' to: (OperatingSystem getEnvironment: 'PATH') , ';' , (OperatingSystem getEnvironment: 'MINGW_DIR') , '\bin'. |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
85 |
cmd := 'mingwmake.bat ' , target. |
1612
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
86 |
]. |
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
87 |
] ifFalse:[ |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
88 |
cmd := 'make -f Makefile.init ', target |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
89 |
]. |
1612
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
90 |
output := String streamContents:[ :s| |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
91 |
success := OperatingSystem executeCommand: cmd outputTo: s inDirectory: packageDir |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
92 |
]. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
93 |
"/ Following is just to ease debugging on Jenkins since stdout |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
94 |
"/ is shown in the report. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
95 |
success ifFalse:[ |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
96 |
Stdout nextPutLine: 'Failed to make target ''', target, ''' in test package'. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
97 |
Stdout nextPutLine: output. |
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
98 |
]. |
1447 | 99 |
self |
1612
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
100 |
assert: success |
1541
5c6a32e00528
Fixed `MakefileTests` and `SnapshotRestartTests` to not call obsolete method OperatingSystem>>getCCDefine
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
101 |
description: 'Failed to make target ''', target, ''' in test package'. |
1008 | 102 |
|
103 |
"Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1543
6d2bdaf0c9ec
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1541
diff
changeset
|
104 |
"Modified: / 10-11-2016 / 00:22:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1612
972b34959a7b
Ensure Borland make is in PATH when running tests that compile code.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1570
diff
changeset
|
105 |
"Modified: / 10-06-2017 / 21:52:13 / jv" |
1008 | 106 |
! ! |
107 |
||
108 |
!MakefileTests methodsFor:'running'! |
|
109 |
||
110 |
setUp |
|
1021
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
111 |
self setUpForPackage:'tmp:makefiletests'. |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
112 |
|
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
113 |
"Created: / 19-11-2013 / 12:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
114 |
"Modified: / 24-11-2013 / 22:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
115 |
! |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
116 |
|
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
117 |
setUpForPackage: pkg |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
118 |
| components | |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
119 |
package := pkg. |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
120 |
packageDir := (Smalltalk getPackageDirectoryForPackage: Object package) directory directory. |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
121 |
components := (package copyReplaceAll: $: with:$/) tokensBasedOn: $/. |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
122 |
components do:[:each | |
1447 | 123 |
packageDir := packageDir / each. |
1021
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
124 |
]. |
1008 | 125 |
packageDir exists ifTrue:[ |
1447 | 126 |
packageDir recursiveRemove. |
1008 | 127 |
]. |
128 |
packageDir recursiveMakeDirectory |
|
129 |
||
1021
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
130 |
"Created: / 24-11-2013 / 22:23:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1008 | 131 |
! ! |
132 |
||
133 |
!MakefileTests methodsFor:'tests'! |
|
134 |
||
135 |
test_application_01 |
|
136 |
||
1570
afeaedfc562e
Added 10min timeout for MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1564
diff
changeset
|
137 |
<timeout: 600> "600sec = 10min" |
afeaedfc562e
Added 10min timeout for MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1564
diff
changeset
|
138 |
|
1008 | 139 |
self run:#'test_application_01' type:ProjectDefinition nonGuiApplicationType toolchain:nil |
140 |
||
141 |
"Created: / 19-11-2013 / 14:05:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1021
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
142 |
! |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
143 |
|
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
144 |
test_application_02 |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
145 |
|
1570
afeaedfc562e
Added 10min timeout for MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1564
diff
changeset
|
146 |
<timeout: 600> "600sec = 10min" |
afeaedfc562e
Added 10min timeout for MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1564
diff
changeset
|
147 |
|
1021
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
148 |
self setUpForPackage: 'tmp:makefiletests2/test_application_02'. |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
149 |
self run:#'test_application_01' type:ProjectDefinition nonGuiApplicationType toolchain:nil |
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
150 |
|
19269c8a3ba6
class: RegressionTests::MakefileTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1008
diff
changeset
|
151 |
"Created: / 24-11-2013 / 22:23:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1008 | 152 |
! ! |
153 |
||
154 |
!MakefileTests methodsFor:'tests-helpers'! |
|
155 |
||
1447 | 156 |
run:packageIdent type:packageType toolchain:toolchain |
1008 | 157 |
| packageDef startup | |
158 |
||
159 |
"/ Compile all classes... |
|
160 |
Class packageQuerySignal answer:package do:[ |
|
1554 | 161 |
(self class privateClasses select:[:cls | cls packageIdent = packageIdent ]) do:[:cls | |
162 |
| copy | |
|
1008 | 163 |
|
1554 | 164 |
copy := cls superclass |
165 |
subclass: cls nameWithoutPrefix |
|
166 |
instanceVariableNames:(cls instVarNames asStringWith:' ') |
|
167 |
classVariableNames:(cls classVarNames asStringWith:' ') |
|
168 |
poolDictionaries:cls poolDictionaries |
|
169 |
category:'** tmp **'. |
|
170 |
cls methodDictionary do:[:each | |
|
171 |
copy compile:each source classified:each category. |
|
172 |
]. |
|
173 |
cls class methodDictionary do:[:each | |
|
174 |
copy class compile:each source classified:each category. |
|
175 |
]. |
|
176 |
(copy inheritsFrom:StandaloneStartup) ifTrue:[ |
|
177 |
startup := copy. |
|
178 |
]. |
|
179 |
]. |
|
180 |
]. |
|
1447 | 181 |
|
1008 | 182 |
"/ Create project definition class. |
1447 | 183 |
Class packageQuerySignal answer:package do:[ |
1554 | 184 |
packageDef := ProjectDefinition |
185 |
definitionClassForPackage:package |
|
186 |
projectType:packageType |
|
187 |
createIfAbsent:true. |
|
188 |
||
189 |
packageDef class compile:'applicationIconFileName ^ nil'. |
|
190 |
packageDef theNonMetaclass |
|
191 |
forEachContentsMethodsCodeToCompileDo:[:code :category | packageDef theMetaclass compile:code classified:category ] |
|
192 |
"/ignoreOldEntries: false |
|
193 |
ignoreOldDefinition: false. |
|
194 |
packageDef isApplicationDefinition ifTrue:[ |
|
195 |
packageDef class compile:'startupClassName ^ ' , startup fullName storeString. |
|
196 |
]. |
|
1447 | 197 |
]. |
1008 | 198 |
"/ Fileout to package directory... |
1447 | 199 |
|
200 |
packageDef classes do:[:class | |
|
1554 | 201 |
| container | |
1008 | 202 |
|
1554 | 203 |
container := (class fullName copyReplaceAll:$: with:$_) , '.st'. |
204 |
(packageDir / container) |
|
205 |
writingFileDo:[:f | |
|
206 |
AbstractSourceCodeManager |
|
207 |
fileOutSourceCodeOf:class |
|
208 |
on:f |
|
209 |
withTimeStamp:false |
|
210 |
withInitialize:true |
|
211 |
withDefinition:true |
|
212 |
methodFilter:[:mth | mth package = package ] |
|
213 |
] |
|
1008 | 214 |
]. |
1447 | 215 |
|
1008 | 216 |
"/ Generate build support files... |
1447 | 217 |
|
218 |
packageDef fileNamesToGenerate keys do:[:filename | |
|
1479
974a26a06296
MakefileTests: Fixed build support file generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1474
diff
changeset
|
219 |
| contents file | |
1008 | 220 |
|
1479
974a26a06296
MakefileTests: Fixed build support file generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1474
diff
changeset
|
221 |
contents := packageDef generateFile:filename. |
974a26a06296
MakefileTests: Fixed build support file generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1474
diff
changeset
|
222 |
contents notNil ifTrue:[ |
1554 | 223 |
file := (packageDir / filename). |
224 |
file directory recursiveMakeDirectory. |
|
1479
974a26a06296
MakefileTests: Fixed build support file generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1474
diff
changeset
|
225 |
file writingFileDo:[:f | f nextPutAll: contents]. |
974a26a06296
MakefileTests: Fixed build support file generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1474
diff
changeset
|
226 |
] |
1008 | 227 |
]. |
228 |
||
229 |
self make. |
|
230 |
||
231 |
"Created: / 19-11-2013 / 14:07:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1479
974a26a06296
MakefileTests: Fixed build support file generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1474
diff
changeset
|
232 |
"Modified: / 12-02-2016 / 15:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1008 | 233 |
! ! |
234 |
||
235 |
!MakefileTests::TestApplication01 class methodsFor:'accessing'! |
|
236 |
||
237 |
packageIdent |
|
238 |
^ #test_application_01 |
|
239 |
||
240 |
"Created: / 19-11-2013 / 14:04:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
241 |
! ! |
|
242 |
||
243 |
!MakefileTests::TestApplication01 class methodsFor:'startup-to be redefined'! |
|
244 |
||
245 |
main:args |
|
246 |
args isEmpty ifTrue:[ |
|
1447 | 247 |
Smalltalk exit: 0. |
1008 | 248 |
]. |
249 |
args size ~~ 1 ifTrue:[ |
|
1447 | 250 |
Smalltalk exit: 127. |
1008 | 251 |
]. |
252 |
||
253 |
[ |
|
1447 | 254 |
Smalltalk exit: args first asInteger. |
1008 | 255 |
] on: Error do:[:ex| |
1447 | 256 |
Smalltalk exit: 126. |
1008 | 257 |
]. |
258 |
||
259 |
"Created: / 19-11-2013 / 13:12:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
260 |
! ! |
|
261 |
||
262 |
!MakefileTests class methodsFor:'documentation'! |
|
263 |
||
264 |
version |
|
265 |
^ '$Header$' |
|
266 |
! |
|
267 |
||
268 |
version_CVS |
|
269 |
^ '$Header$' |
|
1474
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
270 |
! |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
271 |
|
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
272 |
version_HG |
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
273 |
|
54b7f76f0e68
Fixed MakefileTests under Windows/MINGW toolchain
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1148
diff
changeset
|
274 |
^ '$Changeset: <not expanded> $' |
1008 | 275 |
! ! |
276 |