Skip to content
Snippets Groups Projects
Commit 2a5e9e4d authored by Oliver Herms's avatar Oliver Herms
Browse files

Debug

parent edca93ec
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ load("@bazel_gazelle//:def.bzl", "gazelle") ...@@ -2,6 +2,8 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:prefix github.com/bio-routing/bio-rd # gazelle:prefix github.com/bio-routing/bio-rd
# gazelle:resolve go google.golang.org/grpc //vendor/google.golang.org/grpc:go_default_library # gazelle:resolve go google.golang.org/grpc //vendor/google.golang.org/grpc:go_default_library
# gazelle:resolve go golang.org/x/net/context //vendor/golang.org/x/net/context:go_default_library
# gazelle:resolve go github.com/golang/protobuf //vendor/github.com/golang/protobuf:go_default_library
gazelle( gazelle(
name = "gazelle", name = "gazelle",
external = "vendored", external = "vendored",
......
...@@ -22,4 +22,7 @@ go_library( ...@@ -22,4 +22,7 @@ go_library(
embed = [":api_go_proto"], embed = [":api_go_proto"],
importpath = "github.com/bio-routing/bio-rd/net/api", importpath = "github.com/bio-routing/bio-rd/net/api",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [
"//vendor/github.com/golang/protobuf/proto:go_default_library"
],
) )
...@@ -24,4 +24,8 @@ go_library( ...@@ -24,4 +24,8 @@ go_library(
embed = [":api_go_proto"], embed = [":api_go_proto"],
importpath = "github.com/bio-routing/bio-rd/route/api", importpath = "github.com/bio-routing/bio-rd/route/api",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [
"//net/api:go_default_library",
"//vendor/github.com/golang/protobuf/proto:go_default_library",
],
) )
...@@ -113,10 +113,12 @@ func mergeProfBlocks(as, bs []cover.ProfileBlock) []cover.ProfileBlock { ...@@ -113,10 +113,12 @@ func mergeProfBlocks(as, bs []cover.ProfileBlock) []cover.ProfileBlock {
func toSF(profs []*cover.Profile) ([]*SourceFile, error) { func toSF(profs []*cover.Profile) ([]*SourceFile, error) {
var rv []*SourceFile var rv []*SourceFile
for _, prof := range profs { for _, prof := range profs {
//fmt.Printf("###### PROFILE ######\n")
path, err := findFile(prof.FileName) path, err := findFile(prof.FileName)
if err != nil { if err != nil {
log.Fatalf("Can't find %v", err) log.Fatalf("Can't find %v", err)
} }
//fmt.Printf("path: %s\n", path)
fb, err := ioutil.ReadFile(path) fb, err := ioutil.ReadFile(path)
if err != nil { if err != nil {
log.Fatalf("Error reading %v: %v", path, err) log.Fatalf("Error reading %v: %v", path, err)
...@@ -128,6 +130,9 @@ func toSF(profs []*cover.Profile) ([]*SourceFile, error) { ...@@ -128,6 +130,9 @@ func toSF(profs []*cover.Profile) ([]*SourceFile, error) {
} }
for _, block := range prof.Blocks { for _, block := range prof.Blocks {
/*fmt.Printf("StartLine: %d\n", block.StartLine)
fmt.Printf("block.EndLine: %d\n", block.EndLine)
fmt.Printf("len(sf.Coverage): %d\n", len(sf.Coverage))*/
for i := block.StartLine; i <= block.EndLine; i++ { for i := block.StartLine; i <= block.EndLine; i++ {
count, _ := sf.Coverage[i-1].(int) count, _ := sf.Coverage[i-1].(int)
sf.Coverage[i-1] = count + block.Count sf.Coverage[i-1] = count + block.Count
...@@ -147,6 +152,11 @@ func parseCover(fn string) ([]*SourceFile, error) { ...@@ -147,6 +152,11 @@ func parseCover(fn string) ([]*SourceFile, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("Error parsing coverage: %v", err) return nil, fmt.Errorf("Error parsing coverage: %v", err)
} }
fmt.Printf("len(profs): %d\n", len(profs))
for _, prof := range profs {
fmt.Printf("Filename: %s\n", prof.FileName)
}
pfss = append(pfss, profs) pfss = append(pfss, profs)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment