]> code.ossystems Code Review - openembedded-core.git/commitdiff
python3: correctly process ptest output with sed
authorAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 20 Jan 2020 17:24:49 +0000 (18:24 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Jan 2020 12:52:48 +0000 (12:52 +0000)
Particularly:

[ERROR|FAIL] was matching characters rather than strings.

Using (ERROR|FAIL) requires -r option.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3/run-ptest

index 3e45d3918cb6384cb1b67022ac57c9862faa78af..405b07f4959832506d1d8b599c8461c8015c1b63 100644 (file)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-python3 -m test -v | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
+python3 -m test -v | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -r -e '/\.\.\. (ERROR|FAIL)/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'