Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 10 Nov 2016 00:27:25 +0000
branchjv
changeset 1543 6d2bdaf0c9ec
parent 1542 a2d6838ad6f6
child 1544 657989d600f7
child 1945 df22c2c7f4c7
Fixed `MakefileTests` and `SnapshotRestartTests` to work on MSYS2-only systems There GCC is installed in `C:\MSYS64\MING32` and `C:\MSYS64\MINGW64` so when searching for `MINGW_DIR`, look there too.
RegressionTests__MakefileTests.st
RegressionTests__SnapshotRestartTests.st
--- a/RegressionTests__MakefileTests.st	Wed Nov 09 15:43:15 2016 +0000
+++ b/RegressionTests__MakefileTests.st	Thu Nov 10 00:27:25 2016 +0000
@@ -51,25 +51,32 @@
             cmd := 'bmake.bat ' , target.
         ].
         STCCompilerInterface getCCDefine = '__MINGW32__' ifTrue:[ 
-            (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ 
-                self assert: 'C:\MINGW' asFilename exists description: 'MINGW_DIR environment variable not set and C:\MINGW does not exist'.
-                OperatingSystem setEnvironment: 'MINGW_DIR'     to: 'C:\MINGW'.
+            (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[
+                | mingwDir |
+
+                mingwDir := #('C:\MSYS64\MINGW32' 'C:\MINGW') detect:[:path | path asFilename isDirectory ] ifNone: [ nil ].
+                self assert: mingwDir notNil description: 'MINGW_DIR environment variable not set and MINGW32 not found at standard places'.
+                OperatingSystem setEnvironment: 'MINGW_DIR'     to: mingwDir.
             ].
             OperatingSystem setEnvironment: 'MINGW'         to: '__MINGW32__'.
             OperatingSystem setEnvironment: 'USEMINGW_ARG'  to: '-DUSEMINGW32'.
-            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';C:\MINGW\bin'.
+            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';' , (OperatingSystem getEnvironment: 'MINGW_DIR') , '\bin'.
             cmd := 'mingwmake.bat ' , target.
         ].
         STCCompilerInterface getCCDefine = '__MINGW64__' ifTrue:[ 
             (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ 
-                self assert: 'C:\MINGW64' asFilename exists description: 'MINGW_DIR environment variable not set and C:\MINGW does not exist'.
-                OperatingSystem setEnvironment: 'MINGW_DIR'     to: 'C:\MINGW64'.
+                | mingwDir |
+
+                mingwDir := #('C:\MSYS64\MINGW64' 'C:\MINGW64') detect:[:path | path asFilename isDirectory ] ifNone: [ nil ].
+                self assert: mingwDir notNil description: 'MINGW_DIR environment variable not set and MINGW64 not found at standard places'.
+                OperatingSystem setEnvironment: 'MINGW_DIR'     to: mingwDir.   
             ].
             OperatingSystem setEnvironment: 'MINGW'         to: '__MINGW64__'.
             OperatingSystem setEnvironment: 'USEMINGW_ARG'  to: '-DUSEMINGW64'.
-            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';C:\MINGW64\bin'.
+            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';' , (OperatingSystem getEnvironment: 'MINGW_DIR') , '\bin'.
             cmd := 'mingwmake.bat ' , target.
         ].
+
     ] ifFalse:[
         cmd := 'make -f Makefile.init ', target
     ].
@@ -78,8 +85,8 @@
         description: 'Failed to make target ''', target, ''' in test package'.
 
     "Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 19-11-2013 / 18:49:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 05-11-2016 / 22:18:36 / jv"
+    "Modified: / 10-11-2016 / 00:22:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MakefileTests methodsFor:'running'!
--- a/RegressionTests__SnapshotRestartTests.st	Wed Nov 09 15:43:15 2016 +0000
+++ b/RegressionTests__SnapshotRestartTests.st	Thu Nov 10 00:27:25 2016 +0000
@@ -64,25 +64,31 @@
             cmd := 'bmake.bat ' , target.
         ].
         STCCompilerInterface getCCDefine = '__MINGW32__' ifTrue:[ 
-            (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ 
-                self assert: 'C:\MINGW' asFilename exists description: 'MINGW_DIR environment variable not set and C:\MINGW does not exist'.
-                OperatingSystem setEnvironment: 'MINGW_DIR'     to: 'C:\MINGW'.
+            (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[
+                | mingwDir |
+
+                mingwDir := #('C:\MSYS64\MINGW32' 'C:\MINGW') detect:[:path | path asFilename isDirectory ] ifNone: [ nil ].
+                self assert: mingwDir notNil description: 'MINGW_DIR environment variable not set and MINGW32 not found at standard places'.
+                OperatingSystem setEnvironment: 'MINGW_DIR'     to: mingwDir.
             ].
             OperatingSystem setEnvironment: 'MINGW'         to: '__MINGW32__'.
             OperatingSystem setEnvironment: 'USEMINGW_ARG'  to: '-DUSEMINGW32'.
-            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';C:\MINGW\bin'.
+            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';' , (OperatingSystem getEnvironment: 'MINGW_DIR') , '\bin'.
             cmd := 'mingwmake.bat ' , target.
         ].
         STCCompilerInterface getCCDefine = '__MINGW64__' ifTrue:[ 
             (OperatingSystem getEnvironment: 'MINGW_DIR') isNil ifTrue:[ 
-                self assert: 'C:\MINGW64' asFilename exists description: 'MINGW_DIR environment variable not set and C:\MINGW does not exist'.
-                OperatingSystem setEnvironment: 'MINGW_DIR'     to: 'C:\MINGW64'.
+                | mingwDir |
+
+                mingwDir := #('C:\MSYS64\MINGW64' 'C:\MINGW64') detect:[:path | path asFilename isDirectory ] ifNone: [ nil ].
+                self assert: mingwDir notNil description: 'MINGW_DIR environment variable not set and MINGW64 not found at standard places'.
+                OperatingSystem setEnvironment: 'MINGW_DIR'     to: mingwDir.   
             ].
             OperatingSystem setEnvironment: 'MINGW'         to: '__MINGW64__'.
             OperatingSystem setEnvironment: 'USEMINGW_ARG'  to: '-DUSEMINGW64'.
-            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';C:\MINGW64\bin'.
+            OperatingSystem setEnvironment: 'PATH'          to: (OperatingSystem getEnvironment: 'PATH') , ';' , (OperatingSystem getEnvironment: 'MINGW_DIR') , '\bin'.
             cmd := 'mingwmake.bat ' , target.
-        ].
+        ].    
     ] ifFalse:[
         cmd := 'make -f Makefile.init ', target
     ].
@@ -92,6 +98,7 @@
 
     "Created: / 14-08-2013 / 18:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 05-11-2016 / 22:48:25 / jv"
+    "Modified: / 10-11-2016 / 00:23:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SnapshotRestartTests methodsFor:'running'!