Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cl: commentFunc add line #1510

Merged
merged 8 commits into from Nov 3, 2023
Merged

cl: commentFunc add line #1510

merged 8 commits into from Nov 3, 2023

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Nov 1, 2023

coverprofile 格式 filename:line1.col1,line2.col2 numStmts cover 。如果 //line 带有 col 偏移,则计算函数开始结束的 { } col 位置,所以 shadow main 的 line 不加 :col ,在 vscode 插件中将 col 0 修正为 1 即可。

最后一行 main.gop:40.0 对应 shadow main func
mode: set
github.com/goplus/gop/cmd/demo/Rect.gox:6.27,8.2 1 0
github.com/goplus/gop/cmd/demo/demo.go:10.26,12.2 1 1
github.com/goplus/gop/cmd/demo/demo.go:14.15,18.2 3 0
github.com/goplus/gop/cmd/demo/main.gop:18.24,20.2 1 1
github.com/goplus/gop/cmd/demo/main.gop:22.15,26.2 3 0
github.com/goplus/gop/cmd/demo/main.gop:28.20,32.11 4 1
github.com/goplus/gop/cmd/demo/main.gop:32.11,34.3 1 0
github.com/goplus/gop/cmd/demo/main.gop:35.2,35.11 1 1
github.com/goplus/gop/cmd/demo/main.gop:40.0,45.2 4 0

support gop test -coverprofile mycover

func //line filename:line:col

//line main.gop:18:1
func (p *Point) Test() {
//line main.gop:19:1
	fmt.Println(p.x, p.y, p.Info, p.info, p.Info.info, p.i.info)
}

shadow func //line filename:line

//line main.gop:40
func main() {
//line main.gop:40:1
	fmt.Println("hello")
}

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (57106a4) 91.07% compared to head (63306e6) 91.14%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1510      +/-   ##
==========================================
+ Coverage   91.07%   91.14%   +0.06%     
==========================================
  Files          26       27       +1     
  Lines        9525     9549      +24     
==========================================
+ Hits         8675     8703      +28     
+ Misses        686      683       -3     
+ Partials      164      163       -1     
Files Coverage Δ
cl/compile.go 98.82% <100.00%> (-0.01%) ⬇️
cl/stmt.go 96.15% <100.00%> (+0.77%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xushiwei xushiwei merged commit fb14bb9 into goplus:main Nov 3, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants