github.com/simranvc/fabric-ca@v0.0.0-20191030094829-acc364294dde/scripts/check_test_results (about)

     1  #!/bin/bash
     2  #
     3  # Copyright IBM Corp. All Rights Reserved.
     4  #
     5  # SPDX-License-Identifier: Apache-2.0
     6  #
     7  if [ $# -ne 1 ]; then
     8     echo "Usage: check_test_results <results-file>"
     9     exit 1
    10  fi
    11  
    12  TEST_RESULTS=$1
    13  
    14  SC=0
    15  FAILURES=`awk '$1 != "ok" && $1 != "?" && $1$2 != "#testmain" && $1$2$3$4 != "ld:warning:PIEdisabled."' $TEST_RESULTS`
    16  if [ "$FAILURES" != "" ]; then
    17     echo "*** BEGIN FAILURES ***"
    18     echo "$FAILURES"
    19     echo "*** END FAILURES ***"
    20     SC=1
    21  fi
    22  INSUFFICIENT_COVERAGE=`awk '$1 == "?" || ($1 == "ok" && $5 != "100.0%" && substr($5, 0, length($5)-1) < 85)' $TEST_RESULTS`
    23  if [ "$INSUFFICIENT_COVERAGE" != "" ]; then
    24     echo "*** BEGIN INSUFFICIENT TEST COVERAGE (less than 85%) ***"
    25     echo "$INSUFFICIENT_COVERAGE"
    26     echo "*** END INSUFFICIENT TEST COVERAGE (less than 85%) ***"
    27     SC=1
    28  fi
    29  exit $SC