RegressionTests__SnapshotRestartTests.st
branchjv
changeset 1612 972b34959a7b
parent 1601 3952a8200e70
child 1960 66ad86b6ada2
--- a/RegressionTests__SnapshotRestartTests.st	Wed May 31 10:16:42 2017 +0100
+++ b/RegressionTests__SnapshotRestartTests.st	Sat Jun 10 21:57:24 2017 +0100
@@ -26,12 +26,20 @@
 !
 
 make: target
-    | cmd |
+    | cmd output success |
     pkgdir := Smalltalk getPackageDirectoryForPackage: #'stx:goodies/regression/testData/packages/snapshot_restart'.
     self assert: pkgdir notNil.
     self assert: pkgdir isDirectory.     
 
-    OperatingSystem isMSWINDOWSlike ifTrue:[ 
+    OperatingSystem isMSWINDOWSlike ifTrue:[
+        "/ Hack: generally we don't require Borland tools to be installed anymore.
+        "/ However, package build is driwen by Borland make so we distribute
+        "/ it with rakefiles. It's likely not in the PATH, so add it.
+        "/ This code assumes the test is run from build environment.
+        OperatingSystem setEnvironment: 'PATH' to: 
+            (OperatingSystem pathOfSTXExecutable asFilename directory / '..' / '..' / '..' / '..' / 'bin') pathName , ';',
+            (OperatingSystem getEnvironment: 'PATH').
+
         STCCompilerInterface getCCDefine = '__BORLANDC__' ifTrue:[ 
             cmd := 'bmake.bat ' , target.
         ].
@@ -64,13 +72,22 @@
     ] ifFalse:[
         cmd := 'make -f Makefile.init ', target
     ].
+    output := String streamContents:[ :s|
+        success := OperatingSystem executeCommand: cmd outputTo: s inDirectory: pkgdir
+    ].
+    "/ Following is just to ease debugging on Jenkins since stdout
+    "/ is shown in the report.
+    success ifFalse:[ 
+        Stdout nextPutLine: 'Failed to make target ''', target, ''' in test package'.
+        Stdout nextPutLine: output.
+    ].
     self
-        assert: (OperatingSystem executeCommand: cmd inDirectory: pkgdir)
+        assert: success
         description: 'Failed to make target ''', target, ''' in test package'.
 
     "Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 05-11-2016 / 22:48:25 / jv"
     "Modified: / 06-01-2017 / 23:20:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-06-2017 / 21:47:51 / jv"
 ! !
 
 !SnapshotRestartTests methodsFor:'private'!