public TestRunner (IList tests, string working_dir, Driver driver) { this.driver = driver; this.tests = tests; this.working_dir = working_dir; tests_enumerator = tests.GetEnumerator (); tests_lock = new object (); }
private static void CheckEnvVars (Driver d) { string fixture = Environment.GetEnvironmentVariable ("MOON_DRT_FIXTURE"); string fixtures = Environment.GetEnvironmentVariable ("MOON_DRT_FIXTURES"); string categories = Environment.GetEnvironmentVariable ("MOON_DRT_CATEGORIES"); string exclude = Environment.GetEnvironmentVariable ("MOON_DRT_EXCLUDE_CATEGORIES"); string exclude_fixture = Environment.GetEnvironmentVariable ("MOON_DRT_EXCLUDE_FIXTURE"); string exclude_fixtures = Environment.GetEnvironmentVariable ("MOON_DRT_EXCLUDE_FIXTURES"); string fixture_start = Environment.GetEnvironmentVariable ("MOON_DRT_FIXTURE_START"); string swallow = Environment.GetEnvironmentVariable ("MOON_DRT_SWALLOW_STREAMS"); string stdout = Environment.GetEnvironmentVariable ("MOON_DRT_LOG_TO_STDOUT"); SwallowStreams = swallow != null && swallow != string.Empty; LogToStdout = stdout != null && stdout != string.Empty; if ((fixture != null && fixture != String.Empty) && (fixtures != null && fixtures != String.Empty)) Console.Error.WriteLine ("Warning, both MOON_DRT_FIXTURE and MOON_DRT_FIXTURES are set, these will be combined."); if (fixture != null && fixture != String.Empty) d.SetFixtures (fixture); if (fixtures != null && fixtures != String.Empty) d.SetFixtures (fixtures); if (categories != null && categories != String.Empty) d.SetCategories (categories); if (fixture_start != null && fixture_start != String.Empty) d.SetFixtureStart (fixture_start); if (!string.IsNullOrEmpty (exclude)) d.SetExcludeCategories (exclude); if (!string.IsNullOrEmpty (exclude_fixture)) d.SetExcludeFixtures (exclude_fixture); if (!string.IsNullOrEmpty (exclude_fixtures)) d.SetExcludeFixtures (exclude_fixtures); }
public static int Main (string [] args) { int result; DateTime start = DateTime.Now; string drtlist = "drtlist.xml"; Driver d = new Driver (); bool add_console_report = true; CheckEnvVars (d); OptionSet p = new OptionSet (); p.Add ("v|verbose", "Increase the verbosity level (None, ShowShockerLines, ShowStderr, ShowStdout).", delegate (string v) { d.VerboseLevel++; }); p.Add ("fixture=", "Run a single test fixture with the specified name (names are case sensitive).", delegate (string v) { d.SetFixtures (v); }); p.Add ("fixtures=", "Run a set of fixtures (names are case sensitive and seperated by commas).", delegate (string v) { d.SetFixtures (v); }); p.Add ("categories=", "Only run the tests in the specified categories (comma separated list).", delegate (string v) { d.SetCategories (v); }); p.Add ("drtlist=", "Specify the drtlist to be used for the test run.", delegate (string v) { drtlist = GetDrtlistLocation (v); }); p.Add ("agviewer=", "Specify the path to the agviewer binary (if this is not specified a temp agviewer will be created).", delegate (string v) { Agviewer.SetProcessPath (v); }); p.Add ("no-console-report", "Do not report any of the test progress or results on the console.", delegate (string v) { add_console_report = false; }); p.Add ("compare-to-moon", "Compare to the moon master files (generate moon masters before using this option).", delegate (string v) { d.CompareToMoon = true; }); p.Add ("html-report|generate-html-report", "Generate an html report.", delegate (string v) { d.AddReport (new HtmlReport ()); }); p.Add ("run-known-failures", "Run the tests that are marked as known failure.", delegate (string v) { d.RunKnownFailures = true; }); p.Add ("list-known-failures", "List all the tests marked as known failure.", delegate (string v) { d.ListKnownFailures (drtlist); }); p.Add ("generate-master-files", "Generate master files", delegate (string v) { d.GenerateMasterFiles (drtlist); }); p.Add ("run-image-sanity-checks", "Run internal sanity checks on the image compare function.", delegate (string v) { d.RunImageSanityChecks (drtlist); }); p.Add ("runner-server", "Run a standalone server so agviewer can be invoked outside of the runner for debugginer.", delegate (string v) { d.RunServer (drtlist); }); p.Add ("valgrind", "Run agviewer with valgrind. Valgrind will be executed with --tool=memcheck, unless MOONLIGHT_VALGRIND_OPTIONS is set, in which case it will be executed with that value.", delegate (string v) { d.UseValgrind = true; }); p.Add ("gdb", "Run agviewer with gdb.", delegate (string v) { d.UseGdb = true; }); p.Parse (args); if (add_console_report) d.AddReport (new ConsoleReport ()); d.AddReport (new XmlReport ()); d.AddReport (new ComparisonReport ()); d.AddReport (new DbReport()); result = d.Run (drtlist); Console.WriteLine ("Total duration of test run: " + (DateTime.Now - start).ToString ()); return result; }