[Libguestfs] [PATCH v4 3/6] python: Improve harness for running Python tests.

Richard W.M. Jones rjones at redhat.com
Thu Dec 11 14:19:42 UTC 2014


It now understands exit code 77 == skip, amongst other improvements.
---
 python/run-python-tests | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/python/run-python-tests b/python/run-python-tests
index bcc40d8..af849c7 100755
--- a/python/run-python-tests
+++ b/python/run-python-tests
@@ -16,8 +16,23 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-set -e
+errors=0
 
 for f in $srcdir/t/*.py; do
   $PYTHON $f
+  r=$?
+  case $r in
+      0) ;;
+      77)
+          echo "$f: test skipped"
+          ;;
+      *)
+          echo "FAIL: $f"
+          ((errors++))
+          ;;
+  esac
 done
+
+if [ $errors -gt 0 ]; then
+    exit 1
+fi
-- 
2.1.0




More information about the Libguestfs mailing list