Drop unused condition check
[pcp.git] / qa / common.python
blob9bd991e4b9d4b6f5e005e226b55be32f57c8d15e
2 # Common shell routines for testing python modules
3 # Copyright (c) 2012-2014 Red Hat.
6 # get standard environment, filters and checks
7 . ./common.product
8 . ./common.filter
9 . ./common.check
11 python=${PCP_PYTHON_PROG}
12 [ -n "$python" ] || _notrun "No python interpreter configured in \$PCP_PYTHON_PROG"
13 eval $python -c exit 2>/dev/null || _notrun "$python unavailable"
15 # verify output from unittest indicates successful testing
16 _check_unittest()
18 mode=$1
19 file=$2
21 $PCP_ECHO_PROG $PCP_ECHO_N "$mode - ""$PCP_ECHO_C"
22 if grep OK $file
23 then
24 return 0
27 # Give some hint as to what went wrong ...
29 $PCP_AWK_PROG <$file '
30 $1 == "FAIL:" { want = 1 }
31 $1 == "File" { want = 1 }
32 want == 1 && $1 == "Ran" { exit }
33 want == 1 { print }'
34 return 1