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

Go Coverage

by mendelgusmao ST2/ST3

Run tests and highlight uncovered lines right in the gutter

Labels go

Details

  • 2014.11.06.13.33.05
  • github.​com
  • github.​com
  • 4 years ago
  • 5 minutes ago
  • 4 years ago

Installs

  • Total 1K
  • Win 317
  • OS X 808
  • Linux 353
Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6
Windows 0 2 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 0 0 1 0 0 0 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 2 0 0 1 4 1 0 0 0 0 0 2 0 0 0 0 0 1 0 2
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1

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