Improved documentation
This commit is contained in:
@ -1,11 +1,57 @@
|
||||
## Tests
|
||||
|
||||
Basic test run:
|
||||
|
||||
```shell
|
||||
go test ./... -v -cover
|
||||
go test ./... -v
|
||||
```
|
||||
|
||||
Prettier output using `gotestsum`:
|
||||
|
||||
```shell
|
||||
go run gotest.tools/gotestsum@latest
|
||||
```
|
||||
|
||||
## Coverage
|
||||
|
||||
Generate a coverage profile:
|
||||
|
||||
```shell
|
||||
go test -coverpkg=./... -coverprofile=cover.out ./...
|
||||
```
|
||||
|
||||
View the data:
|
||||
|
||||
```shell
|
||||
go tool cover -func cover.out
|
||||
go tool cover -html cover.out
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
Run all benchmarks:
|
||||
|
||||
```shell
|
||||
go test ./tests -run='^$' -bench=. -benchmem
|
||||
```
|
||||
|
||||
Examples only:
|
||||
|
||||
```shell
|
||||
go test ./tests -run='^$' -bench=Examples/ -benchmem
|
||||
```
|
||||
|
||||
## Profiling
|
||||
|
||||
Generate a profile:
|
||||
|
||||
```shell
|
||||
go test ./tests -run='^$' -bench=Examples/ -benchmem -cpuprofile cpu.out -memprofile mem.out
|
||||
```
|
||||
|
||||
View the data:
|
||||
|
||||
```shell
|
||||
go tool pprof --nodefraction=0.1 -http=:8080 ./cpu.out
|
||||
go tool pprof --nodefraction=0.1 -http=:8080 ./mem.out
|
||||
```
|
Reference in New Issue
Block a user