Add some helpful scripts, document them
This commit is contained in:
parent
2a86569618
commit
404a75862d
4 changed files with 31 additions and 0 deletions
7
bin/build_local.sh
Executable file
7
bin/build_local.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
pushd $(dirname "$0")/.. # run from root dir
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
go build -o target/pilgrim main.go
|
||||||
|
|
||||||
|
popd # switch back to dir we started from
|
12
bin/test_coverage.sh
Executable file
12
bin/test_coverage.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
pushd $(dirname "$0")/.. # run from root dir
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
go build -cover -o target/pilgrim_coverage main.go
|
||||||
|
|
||||||
|
chmod 777 ./target/pilgrim_coverage
|
||||||
|
GOCOVERDIR=coverage ./target/pilgrim
|
||||||
|
|
||||||
|
go tool covdata percent -i=coverage
|
||||||
|
|
||||||
|
popd # switch back to dir we started from
|
|
@ -11,4 +11,10 @@ This will build a `pilgrim` binary in the `target` folder:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ go build -o target/pilgrim main.go
|
$ go build -o target/pilgrim main.go
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, run the `build_local.sh` script provided in `bin`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ./bin/build_local.sh
|
||||||
```
|
```
|
|
@ -41,4 +41,10 @@ This will produce several files containing the coverage data. To turn this into
|
||||||
a human-readable format, use the go coverage tool:
|
a human-readable format, use the go coverage tool:
|
||||||
```bash
|
```bash
|
||||||
$ go tool covdata percent -i=coverage
|
$ go tool covdata percent -i=coverage
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, run the `test_coverage.sh` script inside the `bin` directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ./bin/test_coverage.sh
|
||||||
```
|
```
|
Loading…
Add table
Reference in a new issue