]> git.proxmox.com Git - mirror_ovs.git/blobdiff - tests/checkpatch.at
tests: Improve logging for async message control test.
[mirror_ovs.git] / tests / checkpatch.at
index fe21acdf2d222968db6a46921f535ddd1da31853..6c739477227051146a1b4bc1849555eb13267811 100755 (executable)
@@ -3,10 +3,9 @@ AT_BANNER([checkpatch])
 OVS_START_SHELL_HELPERS
 # try_checkpatch PATCH [ERRORS]
 #
-# Runs checkpatch under Python 2 and Python 3, if installed, on the given
-# PATCH, expecting the specified set of ERRORS (and warnings).
+# Runs checkpatch, if installed, on the given PATCH, expecting the
+# specified set of ERRORS (and warnings).
 try_checkpatch() {
-    AT_SKIP_IF([test $HAVE_PYTHON2 = no && test $HAVE_PYTHON3 = no])
     # Take the patch to test from $1.  Remove an initial four-space indent
     # from it and, if it is just headers with no body, add a null body.
     echo "$1" | sed 's/^    //' > test.patch
@@ -22,18 +21,12 @@ try_checkpatch() {
         : > expout
     fi
 
-    try_checkpatch__ "$HAVE_PYTHON2" "$PYTHON2"
-    try_checkpatch__ "$HAVE_PYTHON3" "$PYTHON3"
-}
-try_checkpatch__() {
-    if test $1 = no; then
-        :
-    elif test -s expout; then
-        AT_CHECK([$2 $top_srcdir/utilities/checkpatch.py -q test.patch],
+    if test -s expout; then
+        AT_CHECK([$PYTHON3 $top_srcdir/utilities/checkpatch.py -q test.patch],
                  [1], [stdout])
         AT_CHECK([sed '/^Lines checked:/,$d' stdout], [0], [expout])
     else
-        AT_CHECK([$2 $top_srcdir/utilities/checkpatch.py -q test.patch])
+        AT_CHECK([$PYTHON3 $top_srcdir/utilities/checkpatch.py -q test.patch])
     fi
 }
 OVS_END_SHELL_HELPERS