summaryrefslogtreecommitdiff
path: root/qa/common.python
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
commit47e6e7c84f008a53061e661f31ae96629bc694ef (patch)
tree648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/common.python
downloadpcp-debian/3.9.10.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/common.python')
-rwxr-xr-xqa/common.python31
1 files changed, 31 insertions, 0 deletions
diff --git a/qa/common.python b/qa/common.python
new file mode 100755
index 0000000..86d039d
--- /dev/null
+++ b/qa/common.python
@@ -0,0 +1,31 @@
+#
+# Common shell routines for testing python modules
+# Copyright (c) 2012-2014 Red Hat.
+#
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+# verify output from unittest indicates successful testing
+_check_unittest()
+{
+ mode=$1
+ file=$2
+
+ $PCP_ECHO_PROG $PCP_ECHO_N "$mode - ""$PCP_ECHO_C"
+ if grep OK $file
+ then
+ return 0
+ fi
+
+ # Give some hint as to what went wrong ...
+ #
+ $PCP_AWK_PROG <$file '
+$1 == "FAIL:" { want = 1 }
+$1 == "File" { want = 1 }
+want == 1 && $1 == "Ran" { exit }
+want == 1 { print }'
+ return 1
+}