ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Go Coverage

by mendelgusmao ALL

Run tests and highlight uncovered lines right in the gutter

Labels go

Details

  • 2014.11.06.13.33.05
  • github.​com
  • github.​com
  • 10 years ago
  • 55 minutes ago
  • 10 years ago

Installs

  • Total 2K
  • Win 461
  • Mac 1K
  • Linux 463
Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

SublimeGoCoverage

A plugin that highlights lines that are uncovered by tests.

Configuration

Use Preferences->Package Settings->Go Coverage to configure.

Basically, you should tell where is the test suite (go test, ginkgo, etc) and where the cover profile is saved. The configuration strings are templated and have some variables that will later be replaced when the SublimeGoCoverage calls the test suite.

Example:

With the filename at the view: /home/mendelson/go/src/ephemeris/core/handlers/events.go, the variables will be:

{
        "gopath": "/home/mendelson/go",
        "filename": "/home/mendelson/go/src/ephemeris/core/handlers/events.go",
        "package_dir": "/home/mendelson/go/src/ephemeris/core/handlers",
        "package_name": "handlers",
        "package_full_name": "ephemeris/core/handlers"
}

Usage

Pressing ctrl+alt+g or saving a go file will trigger the execution of the test suite and markers will appear for every line that isn't being covered by the tests. If you have open more than one file of the same package, they'll all have the markers updated.

Screenshot

Inspired by integrum/SublimeRubyCoverage