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
|
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
|
## Platforms
|
||||||
|
|
||||||
|
@ -15,12 +15,13 @@ func Finalize(a asm.Assembler, dlls dll.List) ([]byte, []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c := compiler{
|
c := compiler{
|
||||||
code: make([]byte, 0, len(a.Instructions)*8),
|
code: make([]byte, 0, len(a.Instructions)*8),
|
||||||
codeLabels: make(map[string]Address, 32),
|
codeLabels: make(map[string]Address, 32),
|
||||||
codeStart: codeOffset(),
|
codePointers: make([]*pointer, 0, len(a.Instructions)*8),
|
||||||
data: data,
|
codeStart: codeOffset(),
|
||||||
dataLabels: dataLabels,
|
data: data,
|
||||||
dlls: dlls,
|
dataLabels: dataLabels,
|
||||||
|
dlls: dlls,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, x := range a.Instructions {
|
for _, x := range a.Instructions {
|
||||||
|
@ -1,11 +1,57 @@
|
|||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
Basic test run:
|
||||||
|
|
||||||
```shell
|
```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
|
## Benchmarks
|
||||||
|
|
||||||
|
Run all benchmarks:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go test ./tests -run='^$' -bench=. -benchmem
|
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