Beispiel #1
0
 private TestResult RunTest()
 {
     return(Agviewer.RunTest(this, timeout, out stdout, out stderr));
 }
Beispiel #2
0
        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);
        }