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

Proposal: add a --trace, --trace=on|off to output trace instead of explicitly enable in each test case #66

Closed
xhd2015 opened this issue Apr 16, 2024 · 2 comments
Labels
enhancement New feature or request trace the trace package

Comments

@xhd2015
Copy link
Owner

xhd2015 commented Apr 16, 2024

Currently, if we want to visualize trace of each test ,we need to manually add a line:

func TestHelloWorld(t *testing.T){
    defer trace.Begin()()
    ...
}

But if we don't want trace, we need to manually remove that line, this causes some inconvenience.

So, propose adding a flag --trace flag, that will look like:

xgo test --trace -run TestHelloWorld

If --trace=off or not present, no trace will output.

@xhd2015 xhd2015 added trace the trace package enhancement New feature or request labels Apr 16, 2024
@xhd2015
Copy link
Owner Author

xhd2015 commented Apr 16, 2024

But it seems go test -trace trace.out is already take, so we need another flag.

Change this flag to --stack-trace or --xgo-trace or --strace.

--strace is better because it is shorter.

@xhd2015
Copy link
Owner Author

xhd2015 commented Apr 16, 2024

resolved in #69

@xhd2015 xhd2015 closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request trace the trace package
Projects
None yet
Development

No branches or pull requests

1 participant