Created
March 28, 2018 20:34
-
-
Save jayconrod/f89c849ed80421a8e4b0fabb633e15e8 to your computer and use it in GitHub Desktop.
tiny coverage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | |
# gazelle:prefix example.com/repo | |
load("@bazel_gazelle//:def.bzl", "gazelle") | |
gazelle(name = "gazelle") | |
go_library( | |
name = "go_default_library", | |
srcs = ["lib.go"], | |
importpath = "example.com/repo", | |
visibility = ["//visibility:public"], | |
) | |
go_test( | |
name = "go_default_test", | |
srcs = ["lib_test.go"], | |
embed = [":go_default_library"], | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lib | |
func Live() int { | |
return 12 | |
} | |
func Dead() int { | |
return 34 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lib | |
import ( | |
"testing" | |
) | |
func TestLive(t *testing.T) { | |
Live() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the command to run the coverage?