github.com/zcqzcg/fabric-ca@v2.0.0-alpha.0.20200416163940-d878ee6db75a+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 EXCLUDED_PKGS=( 14 "/api$" 15 "/credential$" 16 "/fabric-ca-client$" 17 "/lib/common$" 18 "/test/fabric-ca-load-tester$" 19 "/mocks$" 20 "integration" 21 "/ldap" 22 "/metrics" 23 ) 24 25 PKGS=`go list github.com/hyperledger/fabric-ca/... | grep -v -f <(printf '%s\n' "${EXCLUDED_PKGS[@]}")` 26 27 gocov test -timeout 15m $PKGS | gocov-xml > coverage.xml 28 } 2>&1 | tee /tmp/test.results 29 30 echo "Finished running all tests" 31 32 $FCA/scripts/check_test_results /tmp/test.results 33 34 exit $?