[libcamera-devel] [PATCH 1/2] tests: v4l2_compat: Prettify failure output

Paul Elder paul.elder at ideasonboard.com
Fri Jul 10 16:15:07 CEST 2020


When a test is being run on a video device, there is output like so:

Testing /dev/video0 with uvcvideo driver...

and when it succeeds, "success" is appended:

Testing /dev/video0 with uvcvideo driver... success

On failure, however, the output of v4l2-compliance is printed before
"failure" is printed, resulting in the first line of the v4l2-compliance
output to be printed on the same line as the message:

Testing /dev/video2 with uvcvideo driver... v4l2-compliance SHA: not available, 64 bits
<v4l2-compliance output>
failure

Move printing of "failure" to the print_output_arr(), where the failed
test output is printed, to prettify the output upon failure.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 test/v4l2_compat/v4l2_compat_test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py
index 99b3d5a..8a8e59e 100755
--- a/test/v4l2_compat/v4l2_compat_test.py
+++ b/test/v4l2_compat/v4l2_compat_test.py
@@ -55,6 +55,7 @@ def extract_result(result):
 
 
 def print_output_arr(output_arr):
+    print('failed')
     print('\n'.join(output_arr))
 
 
@@ -135,7 +136,6 @@ def main(argv):
         ret = test_v4l2_compliance(v4l2_compliance, v4l2_compat, device, driver)
         if ret == TestFail:
             failed.append(device)
-            print('failed')
         else:
             print('success')
         drivers_tested[driver] = True
-- 
2.27.0



More information about the libcamera-devel mailing list