Permalink
Browse files

Initial revision

svn path=/trunk/monocov/; revision=15853
  • Loading branch information...
0 parents commit cb203a9979f943df538a31ff27d6393dec873547 @vargaz vargaz committed Jul 2, 2003
Showing with 3,677 additions and 0 deletions.
  1. +33 −0 ChangeLog
  2. +54 −0 ClassCoverageItem.cs
  3. +111 −0 CoverageItem.cs
  4. +481 −0 CoverageModel.cs
  5. +114 −0 HtmlExporter.cs
  6. +11 −0 LICENSE
  7. +30 −0 MANIFEST
  8. +72 −0 Makefile
  9. +41 −0 MethodCoverageItem.cs
  10. +21 −0 NamespaceCoverageItem.cs
  11. +158 −0 README
  12. +59 −0 SourceFileCoverageData.cs
  13. +283 −0 XmlExporter.cs
  14. +320 −0 coverage.c
  15. +223 −0 gui/gtk/CoverageView.cs
  16. +151 −0 gui/gtk/MonoCov.cs
  17. +121 −0 gui/gtk/monocov.glade
  18. +350 −0 gui/qt/CoverageView.cs
  19. +38 −0 gui/qt/FilterDialog.cs
  20. +234 −0 gui/qt/MonoCov.cs
  21. +63 −0 gui/qt/SourceWindow.cs
  22. +233 −0 gui/qt/filterdialog.ui
  23. +261 −0 nunit-console.cs
  24. +148 −0 style.xsl
  25. +42 −0 symbols.cs
  26. +25 −0 test.cs
  27. BIN trans.gif
@@ -0,0 +1,33 @@
+2003-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * all: Initial import into CVS.
+
+2003-07-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * HtmlExporter.cs: Implemented HTML exporter.
+
+ * style.xsl: Small modifications needed by the HTML export method.
+
+2003-06-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * New version with many enchantments.
+
+2003-01-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * gui/qt/SourceView.cs: fixed viewing of source files which contain
+ tags recognized by QTextEdit.
+
+2003-01-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * coverage.c: Handle nested types correctly.
+
+2002-12-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * coverage.c README: Added filters to the back end. They can be used by
+ passing the '--coverage-args filterfile=<NAME>' argument on the command
+ line.
+
+2002-12-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * first public version.
+
@@ -0,0 +1,54 @@
+
+using System;
+using System.Collections;
+
+namespace MonoCov {
+
+public class ClassCoverageItem : CoverageItem {
+
+ /// the namespace to which this class belongs
+ public string name_space;
+
+ /// the scoped name of this class
+ public string name;
+
+ public SourceFileCoverageData sourceFile;
+
+ // The type object representing this class
+ public Type type;
+
+ // Contains MethodBase -> MethodCoverageData mappings
+ public Hashtable methodsByMethod;
+
+ public ClassCoverageItem (CoverageItem parent) : base (parent) {
+ methodsByMethod = new Hashtable ();
+ }
+
+ public ArrayList Methods {
+ get {
+ if (children == null)
+ return new ArrayList (0);
+ else
+ return children;
+ }
+ }
+
+ public string FullName {
+ get {
+ if ((name_space == "") || (name_space == "<GLOBAL>"))
+ return name;
+ else
+ return name_space + "." + name;
+ }
+ }
+
+ public string Namespace {
+ get {
+ if (name_space == "<GLOBAL>")
+ return "";
+ else
+ return name_space;
+ }
+ }
+}
+}
@@ -0,0 +1,111 @@
+
+using System;
+using System.Collections;
+
+namespace MonoCov {
+
+public abstract class CoverageItem {
+
+ public int hit;
+ public int missed;
+ public double coveragePercent;
+
+ public bool filtered;
+
+ public CoverageItem parent;
+
+ public ArrayList children;
+
+ public CoverageItem () {
+ hit = 0;
+ missed = 0;
+ coveragePercent = 0.0;
+ }
+
+ public CoverageItem (CoverageItem parent) : this () {
+ if (parent != null)
+ parent.AddChildren (this);
+ }
+
+ public void AddChildren (CoverageItem item) {
+ if (children == null)
+ children = new ArrayList ();
+ children.Add (item);
+ item.parent = this;
+ }
+
+ public virtual bool IsLeaf {
+ get {
+ return false;
+ }
+ }
+
+ public int ChildCount {
+ get {
+ if (children == null)
+ return 0;
+ else
+ return children.Count;
+ }
+ }
+
+ public void setCoverage (int hit, int missed) {
+ this.hit = hit;
+ this.missed = missed;
+ if (hit + missed == 0)
+ coveragePercent = 100.0;
+ else
+ coveragePercent = (double)hit / (hit + missed);
+ }
+
+ public void computeCoveragePercent () {
+ if (hit + missed == 0)
+ coveragePercent = 100.0;
+ else
+ coveragePercent = (double)hit / (hit + missed);
+ }
+
+ public void computeCoverage () {
+ computeCoverage (false);
+ }
+
+ public void computeCoverage (bool recurse) {
+ if (IsLeaf)
+ return;
+
+ hit = 0;
+ missed = 0;
+
+ if (children != null) {
+ foreach (CoverageItem item in children) {
+ if (!item.filtered) {
+ if (recurse)
+ item.computeCoverage (recurse);
+ hit += item.hit;
+ missed += item.missed;
+ }
+ }
+ }
+
+ computeCoveragePercent ();
+ }
+
+ public void recomputeCoverage () {
+ computeCoverage ();
+
+ if (parent != null)
+ parent.recomputeCoverage ();
+ }
+
+ public void FilterItem (bool isFiltered) {
+ if (filtered != isFiltered) {
+ filtered = isFiltered;
+ recomputeCoverage ();
+ }
+ }
+
+ public override string ToString () {
+ return "" + GetType () + "(hit=" + hit + ", missed=" + missed + ")";
+ }
+}
+}
Oops, something went wrong.

0 comments on commit cb203a9

Please sign in to comment.