[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH v3 3/4] python: Improve harness for running Python tests.



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]