[libcamera-devel] [RFC v3 5/5] py: Add cam.py

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Dec 9 11:15:15 CET 2021


Quoting Tomi Valkeinen (2021-12-09 10:08:20)
> On 09/12/2021 12:03, Kieran Bingham wrote:
> 
> > I'd quite like to see something (anything?) that counts as a unittest
> > integrated into /test/py/ that somehow validates the APIs that are
> > created.
> > 
> > Even if it's only basic for now to construct a camera, or something, so
> > that when built/enabled, the python code can be linked into the test
> > framework with 'ninja -C build test'.
> 
> I've got this:
> 
> https://github.com/tomba/libcamera/blob/py/src/py/test/unittests.py
> 
> I probably could have added it in the series.
> 
> How do you test libcamera with unittests? With vimc?

Precisely ;-)

https://github.com/tomba/libcamera/blob/py/test/camera/capture.cpp#L28

And it's perfectly valid to return that a test is Skipped if it can't
find a camera device (if it expected to need one).

The unit tests are defined as needing the following to run I believe:
  modprobe vimc
  modprobe vim2m

>   Tomi


More information about the libcamera-devel mailing list