Esempio n. 1
0
        byte Report()
        {
            // re-activate all loaded (i.e. selected) rules since some of them could have
            // turned off themselve while executing but we still want them listed in the report
            foreach (Rule rule in Rules)
            {
                rule.Active = true;
            }

            // generate text report (default, to console, if xml and html aren't specified)
            if (console || (log_file != null) || ((xml_file == null) && (html_file == null)))
            {
                using (TextResultWriter writer = new TextResultWriter(this, log_file)) {
                    writer.Report();
                }
            }

            // generate XML report
            if (xml_file != null)
            {
                using (XmlResultWriter writer = new XmlResultWriter(this, xml_file)) {
                    writer.Report();
                }
            }

            // generate HTML report
            if (html_file != null)
            {
                using (HtmlResultWriter writer = new HtmlResultWriter(this, html_file)) {
                    writer.Report();
                }
            }

            return((byte)((0 == Defects.Count) ? 0 : 1));
        }
Esempio n. 2
0
 private void ViewReportButtonClick(object sender, EventArgs e)
 {
     // open web browser on html report
     if (html_report_filename == null)
     {
         html_report_filename = Path.ChangeExtension(Path.GetTempFileName(), ".html");
         using (HtmlResultWriter writer = new HtmlResultWriter(Runner, html_report_filename)) {
             writer.Report();
         }
     }
     Open(html_report_filename);
 }
Esempio n. 3
0
		byte Report ()
		{
			// re-activate all loaded (i.e. selected) rules since some of them could have
			// turned off themselve while executing but we still want them listed in the report
			foreach (Rule rule in Rules) {
				rule.Active = true;
			}

			// generate text report (default, to console, if xml and html aren't specified)
			if ((log_file != null) || ((xml_file == null) && (html_file == null))) {
				using (TextResultWriter writer = new TextResultWriter (this, log_file)) {
					writer.Report ();
				}
			}

			// generate XML report
			if (xml_file != null) {
				using (XmlResultWriter writer = new XmlResultWriter (this, xml_file)) {
					writer.Report ();
				}
			}

			// generate HTML report
			if (html_file != null) {
				using (HtmlResultWriter writer = new HtmlResultWriter (this, html_file)) {
					writer.Report ();
				}
			}

			return (byte) ((0 == Defects.Count) ? 0 : 1);
		}
Esempio n. 4
0
		private void ViewReportButtonClick (object sender, EventArgs e)
		{
			// open web browser on html report
			if (html_report_filename == null) {
				html_report_filename = Path.ChangeExtension (Path.GetTempFileName (), ".html");
				using (HtmlResultWriter writer = new HtmlResultWriter (Runner, html_report_filename)) {
					writer.Report ();
				}
			}
			Open (html_report_filename);
		}