diff --git a/bin/build_local.sh b/bin/build_local.sh new file mode 100755 index 0000000..74a2625 --- /dev/null +++ b/bin/build_local.sh @@ -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 \ No newline at end of file diff --git a/bin/test_coverage.sh b/bin/test_coverage.sh new file mode 100755 index 0000000..a3035c1 --- /dev/null +++ b/bin/test_coverage.sh @@ -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 \ No newline at end of file diff --git a/docs/SETUP.md b/docs/SETUP.md index df50b86..01b8d0e 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -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 ``` \ No newline at end of file diff --git a/docs/TESTS.md b/docs/TESTS.md index 54ad60c..27363eb 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -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 ``` \ No newline at end of file