private void RunLocationServerIfNeeded() { if (location == null) { return; } Console.WriteLine("Harness: Trying to start xsp on port {0}", LocationPort); do { string args = String.Format("--applications '{0}:{1},/:.' --nonstop --port {2}", location_uri.AbsolutePath, base_directory, LocationPort); location_xsp = new ExternalProcess("xsp2", args, -1); location_xsp.RedirectStdOut = true; location_xsp.Run(false); if (!WaitForXsp(location_xsp)) { Console.WriteLine("Harness: Could not start xsp at port {0}, trying port {1}", LocationPort, AvailableLocationPort); LocationPort = AvailableLocationPort++; continue; } else { Console.WriteLine("Harness. Started xsp on port {0} (args: {1})", LocationPort, args); break; } } while (true); }
private void CodeBehindCompileIfNeeded() { if (codebehind == null) { return; } string [] pieces = codebehind.Split(','); string cs_file = Path.Combine(base_directory, pieces [0].Trim()); string lib_name = null; if (pieces.Length > 1) { lib_name = pieces [1].Trim(); } string args = String.Format("-pkg:silver /target:library {0} {1}", lib_name != null ? String.Concat("/out:", lib_name) : String.Empty, cs_file); using (ExternalProcess gmcs = new ExternalProcess("gmcs", args, -1)) { gmcs.Run(true); if (gmcs.ExitCode < 0) { SetFailedReason(String.Format("Unable to compile codebehind file: {0}.", gmcs.Stderr)); return; } } }
public static TestResult RunTest (Test test, int timeout, out string stdout, out string stderr) { if (agviewer_process == null || !agviewer_process.IsRunning) { if (agviewer_process != null) { agviewer_process.Kill (); } string args = String.Format ("-working-dir {0} {1}", Path.GetFullPath (Path.GetDirectoryName (test.InputFile)), Path.GetFullPath (test.InputFile)); agviewer_process = new ExternalProcess (GetProcessPath (), args, timeout); if (!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("MOON_PATH"))) agviewer_process.EnvironmentVariables ["MONO_PATH"] = Environment.GetEnvironmentVariable ("MOON_PATH") + ":" + Environment.GetEnvironmentVariable ("MONO_PATH"); agviewer_process.Run (false); } else { Console.WriteLine ("agviewer process not shutdown: {0}.", agviewer_process.IsRunning); // logging_server.RunNextTest (Path.GetFullPath (test.InputFile)); } stdout = String.Empty; // ep.Stdout; stderr = String.Empty; // ep.Stder; /* if (!logging_server.WaitForTestToComplete (test.InputFileName, agviewer_process, timeout)) { test.SetFailedReason ("Test timed out."); return TestResult.Fail; } */ return TestResult.Pass; }
private void RunXspIfNeeded() { if (xsp_exec_dir == null) { return; } string args = String.Format("--root {0} --nonstop", Path.Combine(Path.GetDirectoryName(LocalFilePath), xsp_exec_dir)); xsp = new ExternalProcess("xsp", args, -1); xsp.RedirectStdOut = true; xsp.Run(false); if (!WaitForXsp(xsp)) { // We can't try another port, given that tests assume xsp is running on 8080. Console.WriteLine("Harness: xsp didn't startup correctly, assuming there already is an xsp process running."); } }
private void EnsureAgviewerProcess() { if (agviewer_process != null && !agviewer_process.IsRunning) { agviewer_process.Kill(); agviewer_process = null; } if (agviewer_process == null) { string args = String.Format("-working-dir {0}", Path.GetFullPath(working_dir)); string valgrind_args; string gdb_args; if (driver != null && driver.UseValgrind) { valgrind_args = string.Format("{0} {1} {2}", System.Environment.GetEnvironmentVariable("MOONLIGHT_VALGRIND_OPTIONS"), GetProcessPath(), args); agviewer_process = new ExternalProcess("valgrind", valgrind_args, -1); } else if (driver != null && driver.UseGdb) { gdb_args = string.Format("--batch --eval-command=run --args {0} {1}", GetProcessPath(), args); agviewer_process = new ExternalProcess("gdb", gdb_args, -1); } else { agviewer_process = new ExternalProcess(GetProcessPath(), args, -1); } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MOON_PATH"))) { agviewer_process.EnvironmentVariables ["MONO_PATH"] = Environment.GetEnvironmentVariable("MOON_PATH") + ":" + Environment.GetEnvironmentVariable("MONO_PATH"); } agviewer_process.Run(false); } }
public static TestResult RunTest(Test test, int timeout, out string stdout, out string stderr) { if (agviewer_process == null || !agviewer_process.IsRunning) { if (agviewer_process != null) { agviewer_process.Kill(); } string args = String.Format("-working-dir {0} {1}", Path.GetFullPath(Path.GetDirectoryName(test.InputFile)), Path.GetFullPath(test.InputFile)); agviewer_process = new ExternalProcess(GetProcessPath(), args, timeout); if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MOON_PATH"))) { agviewer_process.EnvironmentVariables ["MONO_PATH"] = Environment.GetEnvironmentVariable("MOON_PATH") + ":" + Environment.GetEnvironmentVariable("MONO_PATH"); } agviewer_process.Run(false); } else { Console.WriteLine("agviewer process not shutdown: {0}.", agviewer_process.IsRunning); // logging_server.RunNextTest (Path.GetFullPath (test.InputFile)); } stdout = String.Empty; // ep.Stdout; stderr = String.Empty; // ep.Stder; /* * if (!logging_server.WaitForTestToComplete (test.InputFileName, agviewer_process, timeout)) { * test.SetFailedReason ("Test timed out."); * return TestResult.Fail; * } */ return(TestResult.Pass); }
private void RunLocationServerIfNeeded () { if (location == null) return; Console.WriteLine ("Harness: Trying to start xsp on port {0}", LocationPort); do { string args = String.Format ("--applications '{0}:{1},/:.' --nonstop --port {2}", location_uri.AbsolutePath, base_directory, LocationPort); location_xsp = new ExternalProcess ("xsp2", args, -1); location_xsp.RedirectStdOut = true; location_xsp.Run (false); if (!WaitForXsp (location_xsp)) { Console.WriteLine ("Harness: Could not start xsp at port {0}, trying port {1}", LocationPort, AvailableLocationPort); LocationPort = AvailableLocationPort++; continue; } else { Console.WriteLine ("Harness. Started xsp on port {0} (args: {1})", LocationPort, args); break; } } while (true); }
private void RunXspIfNeeded () { if (xsp_exec_dir == null) return; string args = String.Format ("--root {0} --nonstop", Path.Combine (Path.GetDirectoryName (LocalFilePath), xsp_exec_dir)); xsp = new ExternalProcess ("xsp", args, -1); xsp.RedirectStdOut = true; xsp.Run (false); if (!WaitForXsp (xsp)) { // We can't try another port, given that tests assume xsp is running on 8080. Console.WriteLine ("Harness: xsp didn't startup correctly, assuming there already is an xsp process running."); } }
private void CodeBehindCompileIfNeeded () { if (codebehind == null) return; string [] pieces = codebehind.Split (','); string cs_file = Path.Combine (base_directory, pieces [0].Trim ()); string lib_name = null; if (pieces.Length > 1) lib_name = pieces [1].Trim (); string args = String.Format ("-pkg:silver /target:library {0} {1}", lib_name != null ? String.Concat ("/out:", lib_name) : String.Empty, cs_file); using (ExternalProcess gmcs = new ExternalProcess ("gmcs", args, -1)) { gmcs.Run (true); if (gmcs.ExitCode < 0) { SetFailedReason (String.Format ("Unable to compile codebehind file: {0}.", gmcs.Stderr)); return; } } }