2004-03-08 Nick Drochak <ndrochak@ieee.org>
authorNick Drochak <nickd@mono-cvs.ximian.com>
Mon, 8 Mar 2004 05:10:57 +0000 (05:10 -0000)
committerNick Drochak <nickd@mono-cvs.ximian.com>
Mon, 8 Mar 2004 05:10:57 +0000 (05:10 -0000)
* VBCodeProviderTest.cs: On windows, do not use mono to execute
assembly. Actually, this should be if running on MS's CLR, but
for now it will do.

svn path=/trunk/mcs/; revision=23790

mcs/class/System/Test/Microsoft.VisualBasic/ChangeLog
mcs/class/System/Test/Microsoft.VisualBasic/VBCodeProviderTest.cs

index 8839c96f740f0142168f9ee30a8de096eba05248..221eac9e54cc3f0a161a2e12ee9a991b30e1f8ff 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Nick Drochak  <ndrochak@ieee.org>
+
+       * VBCodeProviderTest.cs: On windows, do not use mono to execute 
+       assembly. Actually, this should be if running on MS's CLR, but
+       for now it will do.
+
 2004-02-04  Jackson Harper <jackson@ximian.com>
 
        * VBCodeProviderTest.cs: Use mono to execute assembly.
index 27ed1fe7dfc9bef58b78b89f77cd17c1dc425c1a..e30c6ff6e57319b87691ca2832f034ed0583912c 100644 (file)
@@ -22,13 +22,30 @@ using System.IO;
 \r
 namespace MonoTests.System.Microsoft.VisualBasic\r
 {\r
+\r
+       enum OsType {\r
+               Windows,\r
+               Unix,\r
+               Mac\r
+       }\r
+\r
        [TestFixture]\r
        public class VBCodeProviderTest : Assertion {\r
        \r
                CodeDomProvider MyVBCodeProvider;\r
+               static OsType OS;\r
+               static char DSC = Path.DirectorySeparatorChar;\r
 \r
                [SetUp]\r
                public void GetReady() { \r
+                       if ('/' == DSC) {\r
+                               OS = OsType.Unix;\r
+                       } else if ('\\' == DSC) {\r
+                               OS = OsType.Windows;\r
+                       } else {\r
+                               OS = OsType.Mac;\r
+                       }\r
+\r
                        MyVBCodeProvider = new VBCodeProvider(); \r
                }\r
 \r
@@ -87,8 +104,13 @@ namespace MonoTests.System.Microsoft.VisualBasic
 \r
                        // Execute the test app\r
                        ProcessStartInfo NewProcInfo = new ProcessStartInfo();\r
-                       NewProcInfo.FileName = "mono";\r
-                       NewProcInfo.Arguments = MyVBCodeCompilerResults.CompiledAssembly.Location;\r
+                       if (Windows) {\r
+                               NewProcInfo.FileName = MyVBCodeCompilerResults.CompiledAssembly.Location;\r
+                       }\r
+                       else {\r
+                               NewProcInfo.FileName = "mono";\r
+                               NewProcInfo.Arguments = MyVBCodeCompilerResults.CompiledAssembly.Location;\r
+                       }\r
                        NewProcInfo.RedirectStandardOutput = true;\r
                        NewProcInfo.UseShellExecute = false;\r
                        NewProcInfo.CreateNoWindow = true;\r
@@ -103,7 +125,7 @@ namespace MonoTests.System.Microsoft.VisualBasic
                        }\r
                        catch (Exception ex)\r
                        {\r
-                               Assert("#JW34 - " + ex.Message + Environment.NewLine + ex.StackTrace, false);\r
+                               Fail("#JW34 - " + ex.Message + Environment.NewLine + ex.StackTrace);\r
                        }\r
                        AssertEquals("#JW33 - Application output", "Hello world!", TestAppOutput);\r
 \r
@@ -137,5 +159,26 @@ namespace MonoTests.System.Microsoft.VisualBasic
                        //System.Runtime.Remoting.ObjRef CreateObjRef(System.Type requestedType)\r
                }\r
 \r
+               bool Windows\r
+               {\r
+                       get {\r
+                               return OS == OsType.Windows;\r
+                       }\r
+               }\r
+\r
+               bool Unix\r
+               {\r
+                       get {\r
+                               return OS == OsType.Unix;\r
+                       }\r
+               }\r
+\r
+               bool Mac\r
+               {\r
+                       get {\r
+                               return OS == OsType.Mac;\r
+                       }\r
+               }\r
+\r
        }\r
 }\r