]> code.ossystems Code Review - openembedded-core.git/commitdiff
libusb: ptest: don't skip debug output and fix failures processing
authorMaksym Kokhan via Openembedded-core <openembedded-core@lists.openembedded.org>
Thu, 4 Oct 2018 13:59:01 +0000 (16:59 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Oct 2018 13:13:48 +0000 (14:13 +0100)
Current run-ptest script prints nothing, when stress tests fail.
Fix it in new implementation, discarding external dependency on sed.
Also leave in place all stress output, just add standard ptest result.

Fixes: 3f0106bf2e41 ("libusb: Add ptest")
Signed-off-by: Maksym Kokhan <maksym.kokhan@globallogic.com>
Reviewed-by: Andrii Bordunov <andrii.bordunov@globallogic.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/libusb/libusb1/run-ptest

index 646a966ef9d44be2b808a2c9e6694f02d436e781..eaa47a2bc4f074dc3e68b680b64045e992ff935c 100755 (executable)
@@ -4,12 +4,26 @@ echo
 echo "---------------------------- libusb1 tests ---------------------------"
 echo
 
-./stress | tr '\n' ' '  | \
-sed 's/Starting test run: \([a-zA-Z_]*\)\.\.\. \([a-zA-Z_]*\) (.) /\2 \1\n/g' | \
-sed '$d' | \
-sed '{
-       s/^Success/PASS:/g
-       s/^Failure/FAIL:/g
-       s/^Error/FAIL:/g
-       s/^Skip/SKIP:/g
-}' 
+./stress | { \
+while read -r str
+do
+       echo "$str"
+       if [ "${str#*Starting test run:}" != "$str" ]
+       then
+               name="${str#Starting test run: }"
+               name="${name%...}"
+       else
+               case "$str" in
+                       "Success (0)")
+                               echo "PASS: $name"
+                       ;;
+                       "Failure (1)" | "Error (2)")
+                               echo "FAIL: $name"
+                       ;;
+                       "Skip (3)")
+                               echo "SKIP: $name"
+                       ;;
+               esac
+       fi
+done
+}