[runtime] Fix "make distcheck"
[mono-project.git] / mono / tests / bug-17537.cs
blob747ac361f80c77ea3cd4cb0d6e4116c65d3f4540
1 using System;
2 using System.IO;
3 using System.Diagnostics;
5 public class Test {
6 public static int Main(string[] args)
8 // Only run this test on Unix
9 int pl = (int) Environment.OSVersion.Platform;
10 if ((pl != 4) && (pl != 6) && (pl != 128)) {
11 return 0;
14 // Try to invoke the helper assembly
15 // Return 0 only if it is successful
16 try
18 var name = "bug-17537-helper.exe";
19 Console.WriteLine ("Launching subprocess: {0}", name);
20 var p = new Process();
21 p.StartInfo.FileName = Path.Combine (AppDomain.CurrentDomain.BaseDirectory + name);
22 p.StartInfo.UseShellExecute = false;
24 var result = p.Start();
25 p.WaitForExit(1000);
26 if (result) {
27 Console.WriteLine ("Subprocess started successfully");
28 return 0;
29 } else {
30 Console.WriteLine ("Subprocess failure");
31 return 1;
34 catch (Exception e)
36 Console.WriteLine ("Subprocess exception");
37 Console.WriteLine (e.Message);
38 return 1;