Commit graph

5 commits

Author SHA1 Message Date
Paul Elder
df58fc1f4b test: v4l2_compat_test: Fix v4l2-compliance version parsing
v4l2-compliance changed their version string:

v4l2-compliance 1.21.0-4618
v4l2-compliance SHA: cc211b76476aca2c072ffa83a9b003957d5f3909, 64 bits, 64-bit time_t

v4l2-compliance 1.21.0-4838, 64 bits, 64-bit time_t

The current parsing takes the last result of split, which works for the
former, but not the latter. Take the second result of split instead, and
strip away any commas.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-09-10 10:32:57 +09:00
Paul Elder
c3548a333f tests: v4l2_compat: Fix v4l2-compliance and v4l2-ctl version parsing
v4l2-compliance originally printed the SHA before the version, leading
to the indexing that was used previously. Now that the version is
printed before the SHA, the indexing is incorrect. Fix this.

Although v4l2-ctl doesn't suffer the same issue, it is more correct to
use the zeroth index like the v4l2-compliance version check now does, so
fix that as well.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 18:50:10 +09:00
Paul Elder
74c8b50833 tests: v4l2_compat: Check v4l2-compliance and v4l2-ctl versions
v4l2-compliance and v4l2-ctl with version 1.20 and before will fail with
v4l2-compat. Check the versions of v4l2-compliance and v4l2-ctl before
continuing.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-13 19:46:24 +09:00
Paul Elder
ce32ca4918 tests: v4l2_compat: Prettify failure output
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

Refactor the code to make "failure" print before the output of the test,
to prettify the output upon failure.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-13 19:46:11 +09:00
Paul Elder
e37e72c61c tests: v4l2_compat: Add test for v4l2_compat
Test the V4L2 compatibility layer by running v4l2-compliance -s on every
/dev/video* device.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-10 16:11:53 +09:00