예제 #1
0
        public static void Main(string[] Args)
        {
            string reportFileName = null;
            bool   useAnsiColors  = false;

            foreach (var arg in Args)
            {
                if (arg == "--ansi")
                {
                    useAnsiColors = true;
                }
                else if (reportFileName != null)
                {
                    WriteLine("usage: gtest-report-print [--ansi] gtest-report.xml");
                    return;
                }
                else
                {
                    reportFileName = arg;
                }
            }

            // Parse the report.
            var doc = new XmlDocument();

            doc.Load(reportFileName);
            var report = ReportParser.ParseReport(doc);

            // And print it.
            var printer = new ReportPrinter(useAnsiColors);

            printer.PrintReport(report);
        }
예제 #2
0
        /// <summary>
        /// Parses the report at the given path.
        /// </summary>
        /// <param name="Path">The path at which the report can be found.</param>
        /// <returns></returns>
        private static TestReport ParseReport(string Path)
        {
            var doc = new XmlDocument();

            doc.Load(Path);
            var report = ReportParser.ParseReport(doc);

            return(new TestReport(GetFileNameWithoutExtension(Path), report.TestSuites));
        }