Improved documentation
This commit is contained in:
parent
36d0142573
commit
8b932fb332
@ -33,7 +33,7 @@ You can take a look at the [examples](../examples).
|
||||
go run gotest.tools/gotestsum@latest
|
||||
```
|
||||
|
||||
This will run over 350 tests in various categories.
|
||||
This will run over 350 [tests](../tests) in various categories.
|
||||
|
||||
## Platforms
|
||||
|
||||
|
@ -15,12 +15,13 @@ func Finalize(a asm.Assembler, dlls dll.List) ([]byte, []byte) {
|
||||
}
|
||||
|
||||
c := compiler{
|
||||
code: make([]byte, 0, len(a.Instructions)*8),
|
||||
codeLabels: make(map[string]Address, 32),
|
||||
codeStart: codeOffset(),
|
||||
data: data,
|
||||
dataLabels: dataLabels,
|
||||
dlls: dlls,
|
||||
code: make([]byte, 0, len(a.Instructions)*8),
|
||||
codeLabels: make(map[string]Address, 32),
|
||||
codePointers: make([]*pointer, 0, len(a.Instructions)*8),
|
||||
codeStart: codeOffset(),
|
||||
data: data,
|
||||
dataLabels: dataLabels,
|
||||
dlls: dlls,
|
||||
}
|
||||
|
||||
for _, x := range a.Instructions {
|
||||
|
@ -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
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user