Add some helpful scripts, document them

This commit is contained in:
Miroslav Vasilev 2025-03-18 22:16:42 +02:00
parent 2a86569618
commit 404a75862d
Signed by: mvv
GPG key ID: 92BACFBE98721A3F
4 changed files with 31 additions and 0 deletions

7
bin/build_local.sh Executable file
View 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
View 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

View file

@ -11,4 +11,10 @@ This will build a `pilgrim` binary in the `target` folder:
```bash
$ go build -o target/pilgrim main.go
```
Alternatively, run the `build_local.sh` script provided in `bin`
```bash
$ ./bin/build_local.sh
```

View file

@ -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:
```bash
$ go tool covdata percent -i=coverage
```
Alternatively, run the `test_coverage.sh` script inside the `bin` directory:
```bash
$ ./bin/test_coverage.sh
```