24 |
24 |
25 "Created: / 14-08-2013 / 18:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
25 "Created: / 14-08-2013 / 18:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
26 ! |
26 ! |
27 |
27 |
28 make: target |
28 make: target |
29 | cmd | |
29 | cmd output success | |
30 pkgdir := Smalltalk getPackageDirectoryForPackage: #'stx:goodies/regression/testData/packages/snapshot_restart'. |
30 pkgdir := Smalltalk getPackageDirectoryForPackage: #'stx:goodies/regression/testData/packages/snapshot_restart'. |
31 self assert: pkgdir notNil. |
31 self assert: pkgdir notNil. |
32 self assert: pkgdir isDirectory. |
32 self assert: pkgdir isDirectory. |
33 |
33 |
34 OperatingSystem isMSWINDOWSlike ifTrue:[ |
34 OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
35 "/ Hack: generally we don't require Borland tools to be installed anymore. |
|
36 "/ However, package build is driwen by Borland make so we distribute |
|
37 "/ it with rakefiles. It's likely not in the PATH, so add it. |
|
38 "/ This code assumes the test is run from build environment. |
|
39 OperatingSystem setEnvironment: 'PATH' to: |
|
40 (OperatingSystem pathOfSTXExecutable asFilename directory / '..' / '..' / '..' / '..' / 'bin') pathName , ';', |
|
41 (OperatingSystem getEnvironment: 'PATH'). |
|
42 |
35 STCCompilerInterface getCCDefine = '__BORLANDC__' ifTrue:[ |
43 STCCompilerInterface getCCDefine = '__BORLANDC__' ifTrue:[ |
36 cmd := 'bmake.bat ' , target. |
44 cmd := 'bmake.bat ' , target. |
37 ]. |
45 ]. |
38 STCCompilerInterface getCCDefine = '__MINGW32__' ifTrue:[ |
46 STCCompilerInterface getCCDefine = '__MINGW32__' ifTrue:[ |
39 (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ |
47 (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ |
62 cmd := 'mingwmake.bat ' , target. |
70 cmd := 'mingwmake.bat ' , target. |
63 ]. |
71 ]. |
64 ] ifFalse:[ |
72 ] ifFalse:[ |
65 cmd := 'make -f Makefile.init ', target |
73 cmd := 'make -f Makefile.init ', target |
66 ]. |
74 ]. |
|
75 output := String streamContents:[ :s| |
|
76 success := OperatingSystem executeCommand: cmd outputTo: s inDirectory: pkgdir |
|
77 ]. |
|
78 "/ Following is just to ease debugging on Jenkins since stdout |
|
79 "/ is shown in the report. |
|
80 success ifFalse:[ |
|
81 Stdout nextPutLine: 'Failed to make target ''', target, ''' in test package'. |
|
82 Stdout nextPutLine: output. |
|
83 ]. |
67 self |
84 self |
68 assert: (OperatingSystem executeCommand: cmd inDirectory: pkgdir) |
85 assert: success |
69 description: 'Failed to make target ''', target, ''' in test package'. |
86 description: 'Failed to make target ''', target, ''' in test package'. |
70 |
87 |
71 "Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
88 "Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72 "Modified: / 05-11-2016 / 22:48:25 / jv" |
|
73 "Modified: / 06-01-2017 / 23:20:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
89 "Modified: / 06-01-2017 / 23:20:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
90 "Modified: / 10-06-2017 / 21:47:51 / jv" |
74 ! ! |
91 ! ! |
75 |
92 |
76 !SnapshotRestartTests methodsFor:'private'! |
93 !SnapshotRestartTests methodsFor:'private'! |
77 |
94 |
78 do: setupBlock onRestartDo: restartBlock |
95 do: setupBlock onRestartDo: restartBlock |