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