github.com/extrame/fabric-ca@v2.0.0-alpha+incompatible/scripts/run_unit_tests (about) 1 #!/bin/bash 2 # 3 # Copyright IBM Corp. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 FCA=$GOPATH/src/github.com/hyperledger/fabric-ca 8 9 echo "Running unit tests ..." 10 { 11 export PATH=$PATH:$GOPATH/bin 12 13 go get github.com/axw/gocov/... 14 go get github.com/AlekSi/gocov-xml 15 16 EXCLUDED_PKGS=( 17 "/api$" 18 "/credential$" 19 "/fabric-ca-client$" 20 "/lib/common$" 21 "/test/fabric-ca-load-tester$" 22 "/mocks$" 23 "integration" 24 "/ldap" 25 "/metrics" 26 ) 27 28 PKGS=`go list github.com/hyperledger/fabric-ca/... | grep -v -f <(printf '%s\n' "${EXCLUDED_PKGS[@]}")` 29 30 gocov test -timeout 15m $PKGS | gocov-xml > coverage.xml 31 } 2>&1 | tee /tmp/test.results 32 33 echo "Finished running all tests" 34 35 $FCA/scripts/check_test_results /tmp/test.results 36 37 exit $?