Skip to content
Snippets Groups Projects
  1. Jan 07, 2024
  2. Jan 03, 2024
  3. Apr 25, 2023
  4. Aug 05, 2021
  5. Jul 16, 2021
  6. Feb 04, 2021
  7. Dec 08, 2020
  8. Nov 18, 2020
  9. Aug 18, 2020
  10. Aug 17, 2020
  11. Jul 14, 2019
  12. Feb 17, 2018
  13. Feb 15, 2018
    • Marc Abramowitz's avatar
      Disallow line appearing more than once · c42e4b73
      Marc Abramowitz authored
      I'm not an expert on Cobertura, but it seems confusing to have stuff
      like:
      
      ```
      <line number="5" hits="1"></line>
      <line number="5" hits="0"></line>
      ```
      
      I decided to treat this situation in a pessimistic way - i.e.: if the
      second entry for a line number is lower than the previous one, then we
      update the hit count down; but we never update it up. In other words, if
      we ever see a 0 for a line, we mark the line uncovered, even if we
      previously saw a 1.
      c42e4b73
    • Marc Abramowitz's avatar
      Calculate aggregate stats · 93e82da4
      Marc Abramowitz authored
      93e82da4
  14. Feb 14, 2018
    • Marc Abramowitz's avatar
      Use testdata as-is without gen from template · 53dfefa9
      Marc Abramowitz authored
      While trying to run `gocover-cobertura` on `testdata/testdata_set.txt`, I noticed that
      it's actually a Go template; not actual data; so the tool can't process
      it. The template seems to be just to replace `{{.PkgPath}}` with the
      current directory. By using `.` instead in that file, it eliminates the
      need for a bunch of code for rendering the template (it eliminates
      2 stdlib imports, not that it's a big deal)
      
      Before:
      
      ```
      $ gocover-cobertura < testdata/testdata_set.txt | head -n 18
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
      <coverage line-rate="0" branch-rate="0" version="" timestamp="1518632283054" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0" complexity="0">
      	<sources>
      		<source>/usr/local/Cellar/go/1.10rc1/libexec/src</source>
      		<source>/Users/abramowi/go/src</source>
      	</sources>
      	<packages></packages>
      </coverage>
      ```
      
      After:
      
      ```
      $ gocover-cobertura < testdata/testdata_set.txt | head -n 18
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
      <coverage line-rate="0" branch-rate="0" version="" timestamp="1518632265239" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0" complexity="0">
      	<sources>
      		<source>/usr/local/Cellar/go/1.10rc1/libexec/src</source>
      		<source>/Users/abramowi/go/src</source>
      	</sources>
      	<packages>
      		<package name="./testdata" line-rate="0" branch-rate="0" complexity="0">
      			<classes>
      				<class name="-" filename="./testdata/func1.go" line-rate="0" branch-rate="0" complexity="0">
      					<methods>
      						<method name="Func1" signature="" line-rate="0" branch-rate="0" complexity="0">
      							<lines>
      								<line number="4" hits="1"></line>
      								<line number="5" hits="1"></line>
      								<line number="5" hits="0"></line>
      								<line number="6" hits="0"></line>
      ```
      53dfefa9
  15. Feb 10, 2018
  16. Feb 09, 2018
Loading