github.com/trustbloc/kms-go@v1.1.2/scripts/check_unit.sh (about) 1 #!/bin/bash 2 # 3 # Copyright Avast Software. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 set -e 8 9 echo "Running $0" 10 11 pwd=`pwd` 12 touch "$pwd"/coverage.out 13 14 amend_coverage_file () { 15 if [ -f profile.out ]; then 16 cat profile.out | grep -v ".gen.go" >> "$pwd"/coverage.out 17 rm profile.out 18 fi 19 } 20 21 # Running wallet-sdk unit tests 22 PKGS=`go list github.com/trustbloc/kms-go/... 2> /dev/null | \ 23 grep -v /mocks` 24 go test $PKGS -count=1 -race -coverprofile=profile.out -covermode=atomic -timeout=10m 25 amend_coverage_file 26 27 28 cd "$pwd"