writer

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package writer writes xml file based on the cobertura dtd: https://github.com/cobertura/cobertura/blob/master/cobertura/src/test/resources/dtds/coverage-04.dtd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteXML

func WriteXML(path string, project *entity.Project, outPath string) error

Types

type Class

type Class struct {
	Methods *Methods `xml:"methods"`
	Lines   *Lines   `xml:"lines"`

	Name       string `xml:"name,attr"`
	Filename   string `xml:"filename,attr"`
	LineRate   string `xml:"line-rate,attr"`
	BranchRate string `xml:"branch-rate,attr"`
	Complexity string `xml:"complexity,attr"`
}

type Classes

type Classes struct {
	Classes []*Class `xml:"class"`
}

type Condition

type Condition struct {
	Number   string `xml:"number,attr"`
	Type     string `xml:"type,attr"`
	Coverage string `xml:"coverage,attr"`
}

type Conditions

type Conditions struct {
	Methods []*Condition `xml:"condition"`
}

type Coverage

type Coverage struct {
	XMLName xml.Name `xml:"coverage"`

	Sources  *Sources  `xml:"sources"`
	Packages *Packages `xml:"packages"`

	LineRate        string `xml:"line-rate,attr"`
	BranchRate      string `xml:"branch-rate,attr"`
	LinesCovered    string `xml:"lines-covered,attr"`
	LinesValid      string `xml:"lines-valid,attr"`
	BranchesCovered string `xml:"branches-covered,attr"`
	BranchesValid   string `xml:"branches-valid,attr"`
	Complexity      string `xml:"complexity,attr"`
	Version         string `xml:"version,attr"`
	Timestamp       string `xml:"timestamp,attr"`
}

func ConvertToCobertura

func ConvertToCobertura(path string, project *entity.Project) *Coverage

type Line

type Line struct {
	Conditions *Conditions `xml:"conditions"`

	Number            string `xml:"number,attr"`
	Hits              string `xml:"hits,attr"`
	Branch            string `xml:"branch,attr"`
	ConditionCoverage string `xml:"condition-coverage,attr"`
}

type Lines

type Lines struct {
	Lines []*Line `xml:"line"`
}

type Method

type Method struct {
	Lines *Lines `xml:"lines"`

	Name       string `xml:"name,attr"`
	Signature  string `xml:"signature,attr"`
	LineRate   string `xml:"line-rate,attr"`
	BranchRate string `xml:"branch-rate,attr"`
	Complexity string `xml:"complexity,attr"`
}

type Methods

type Methods struct {
	Methods []*Method `xml:"method"`
}

type Package

type Package struct {
	Classes *Classes `xml:"classes"`

	Name       string `xml:"name,attr"`
	LineRate   string `xml:"line-rate,attr"`
	BranchRate string `xml:"branch-rate,attr"`
	Complexity string `xml:"complexity,attr"`
}

type Packages

type Packages struct {
	Packages []*Package `xml:"package"`
}

type Source

type Source struct {
	Path string `xml:",chardata"`
}

type Sources

type Sources struct {
	Sources []*Source `xml:"source"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL