summaryrefslogtreecommitdiff
path: root/test/meson.build
AgeCommit message (Collapse)Author
2021-08-03test: Add tests for the Flags classLaurent Pinchart
Add tests that exercise the whole API of the Flags class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2021-06-25test: Ensure LIBCAMERA_BASE_PRIVATE isn't publicKieran Bingham
If LIBCAMERA_BASE_PRIVATE is ever exposed on the libcamera public dependencies, then the private.h header protection will be circumvented. Provide a test which will fail (at compile time) if the LIBCAMERA_BASE_PRIVATE define ever leaks to the public dependencies. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-25libcamera: rename public libcamera dependencyKieran Bingham
Now that we have a libcamera_private, make the public only dependency libcamera_public so that it is clear which interface is being linked. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-25libcamera/base: Validate internal headers as privateKieran Bingham
Headers which must not be exposed as part of the public libcamera API should include base/private.h. Any interface which includes the private.h header will only be able to build if the libcamera_private dependency is used (or the libcamera_base_private dependency directly). Build targets which are intended to use the private API's will use the libcamera_private to handle the automatic definition of the inclusion guard. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-28meson: Summarize which applications and adaptation layers are builtLaurent Pinchart
Add the application and adaptation layers being built to the meson summary. The summary now prints libcamera 0.0.0 Configuration Enabled pipelines: ipu3 raspberrypi rkisp1 simple uvcvideo vimc Android support: True GStreamer support: True V4L2 emulation support: True cam application: True qcam application: True Unit tests: True Subprojects libyuv: YES Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
2021-03-12test: delayed_controls: Rename delayed_contols.cpp to delayed_controls.cppNaushir Patuck
There was a typo in the unit test filename. Fix this typo, no other functional change in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-02-04test: Add unit tests for the BayerFormat classSebastian Fricke
Test all of the present methods including the newly implemented `fromV4L2PixelFormat`, as well as the new operators `==/!=`. Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Sebastian Fricke <sebastian.fricke@posteo.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-01-29test: delayed_controls: Add test case for DelayedControlsNiklas Söderlund
Add a test case for DelayedControls that exercises the setting of controls and reading back what controls were used for a particular frame. Also exercise corner cases such as a V4L2 device that does not reset its sequence number to 0 at stream on and sequence number wrapping around the uint32_t value space. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-30meson: test: Simplify top level mesonKieran Bingham
Utilise the subdir_done() functionality as is used with other optional components to simplify the top level meson file. Suggested-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-06test: mapped-buffers: Provide MappedBuffer testKieran Bingham
Provide initial testing framework for the MappedBuffer component. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-31tests: Add a test case for the Object::deleteLater() API, to verifyUmang Jain
- the object is deleted from the correct thread - multiple deleteLater() calls delete the object once only Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-28test: Remove list-cameras testLaurent Pinchart
The list-cameras test case is the very first test case that has been added to libcamera. It has served to start the development of the unit tests infrastructure. Since then, libcamera has grown several tests that cover the same API, and more. It's time for list-cameras to retire. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-10tests: v4l2_compat: Add test for v4l2_compatPaul Elder
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-06-25libcamera: pixel_format: Replace hex with format namesKaaira Gupta
Print format names defined in formats namespace instead of the hex values in toString() as they are easier to comprehend. For this add a property of 'name' in PixelFormatInfo' so as to map the formats with their names. Print fourcc for formats which are not used in libcamera. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-17tests: Introduce hotplug hot-unplug unit testUmang Jain
This test checks the code-paths for camera's hotplugged and unplugged support. It is based on bind/unbind of a UVC device from sysfs. Hence, this test requires root permissions to run and should have at least one already bound UVC device present in the system. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-13licenses: License all meson files under CC0-1.0Laurent Pinchart
In an attempt to clarify the license terms of all files in the libcamera project, the build system files deserve particular attention. While they describe how the binaries are created, they are not themselves transformed into any part of binary distributions of the software, and thus don't influence the copyright on the binary packages. They are however subject to copyright, and thus influence the distribution terms of the source packages. Most of the meson.build files would not meet the threshold of originality criteria required for copyright protection. Some of the more complex meson.build files may be eligible for copyright protection. To avoid any ambiguity and uncertainty, state our intent to not assert copyrights on the build system files by putting them in the public domain with the CC0-1.0 license. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Show Liu <show.liu@linaro.org>
2020-04-14test: Add File class testsLaurent Pinchart
Add tests for the File class API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-06test: Add Span testLaurent Pinchart
Add a compile-only test that exercises the whole Span API, as template functions are not fully compile-tested when the file is parsed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-01-12test: file_descriptor: Add testNiklas Söderlund
Add a test which exercises the whole FileDescriptor interface. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20test: Add control serialization testJacopo Mondi
Add a test that exercises the ControlSerializer to serialize and deserialize ControlInfoMap and ControlList. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20test: Add ByteStreamBuffer testLaurent Pinchart
The test exercises the API of the ByteStreamBuffer class in both read and write modes, including carve out buffers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-15libcamera: utils: Add hex stream output helperLaurent Pinchart
Add a utils::hex() function that simplifies writing hexadecimal values to an ostream. The function handles the '0x' prefix, the field width and the fill character automatically. Use it through the libcamera code base, and add a test. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19test: Get event dispatcher from current threadLaurent Pinchart
For all tests that don't otherwise require access to the camera manager, get the event dispatcher from the current thread instead of the camera manager. This prepares for the removal of CameraManager::instance(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-17test: Add Timer thread move testLaurent Pinchart
The test verifies correct behaviour of a running timer moved to a different thread. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17test: Add EventNotifier thread move testLaurent Pinchart
The test verifies correct behaviour of an enabled event notifier moved to a different thread. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17test: Add Object class thread affinity testLaurent Pinchart
The test verifies thread affinity and thread move notifications. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17test: Add Object::invokeMethod() testLaurent Pinchart
The test verifies correct behaviour of asynchronous method invocation for Object instances. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-17test: logging: move logging tests to a subdirectoryPaul Elder
Since there are two logging tests now, move them to their own subdirectory. Update meson as necessary. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-17test: logging: add logging process testPaul Elder
Add a test to test that logging works in isolated child processes. Only logSetFile is tested, because stdout and stderr are closed for isolated child processes, and syslog and the none logging destinations are expected to be the same as non-isolated processes. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12libcamera: Add Process and ProcessManager classesPaul Elder
Add a Process class to abstract a process, and a ProcessManager singleton to monitor and manage the processes. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12test: add logging API testPaul Elder
Test that setting the log file and log levels works from an application point of view. The test uses the internal logging mechanism as well, just to write to the log file. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-11test: Add test case for signal delivery across threadsLaurent Pinchart
The test case creates a receiver inheriting from Object, connects a signal to one of its slot, moves the receiver to a different thread, emits the signal and verifies that it gets delivered in the correct thread with the expected value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-11test: Add Message test caseLaurent Pinchart
The Message class test creates a receiver inheriting from Object, moves it to a different thread, sends a message to the receiver and verifies that the message is delivered in the correct thread. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-11test: Add Thread test casesLaurent Pinchart
The Thread test case verifies that - a Thread instance is created for the main thread - a new Thread can be created, started, and stopped Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-02libcamera: test: Add ControlValue testKieran Bingham
Add initial basic testing for the new ControlValue class. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-02test: ipc: unix: Add test for IPCUnixSocketNiklas Söderlund
Test that the IPC supports sending data and file descriptors over the IPC medium. To be able to execute the test two parts are needed, one to drive the test and act as the libcamera (master) and a one to act as the IPA (slave). The master drives the testing posting requests to the slave to process and sometimes respond to. A few different tests are performed. - Master sends an array to the slave which responds with a reversed copy of the array. The master verifies that a reversed array is returned. - Master tries to send an empty message making sure that the send call fails. - Master sends a list of file descriptors and ask the slave to calculate and respond with the sum of the size of the files. The master verifies that the calculated size is correct. - Master sends a pre-computed size and a list of file descriptors and asks the slave to verify that the pre-computed size matches the sum of the size of the file descriptors. - Master sends two file descriptors and asks the slave to join the file contents in a new file and respond with its file descriptor. The master then verifies that the content of the returned file descriptor matches the order of the original two files. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-19libcamera: Rename V4L2Device to V4L2VideoDeviceJacopo Mondi
In preparation of creating a new V4L2Device base class, rename V4L2Device to V4L2VideoDevice. This is a project wide rename without any intended functional change. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-19test: stream: Add test for StreamFormatNiklas Söderlund
Test that both discrete and range based stream format descriptions result in good discrete frame sizes. The range based stream formats needs to be fitted with a table of resolutions inside libcamera so if that table is updated this test might need to be updated. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-12tests: Add CameraSensor class testLaurent Pinchart
Add a test to verify media bus codes, sizes and resolution retrieval through the CameraSensor API based on the Sensor A in the vimc pipeline. Also check that the getFormat() method returns the expected media bus code and size. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-05-23meson: Create and use a dependency for libcamera and its headersLaurent Pinchart
Instead of manually adding the libcamera library and include path to every target that requires it, declare a dependency that groups the headers as source, the library and the include path, and use it through the project. This simplifies handling of the dependency. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-05-21test: ipa: add IPAModule testsPaul Elder
Add tests to test the the IPAModule class, for loading the IPA module info from IPA module .so shared objects, with modules written in both C and C++. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-04-18test: geometry: Add tests for Size class comparison operatorsLaurent Pinchart
Add a test that exercises all the comparison operators for the Size class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-14test: camera: Add read default configuration testNiklas Söderlund
Add a test to verify reading the default configuration from a camera works. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-01test: v4l2_subdevice: Add format handling testJacopo Mondi
Add test for video format get and set operations on V4L2Subdevice class. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-01-23tests: Test event dispatcher interruption by signalLaurent Pinchart
Add a test to verify that the event dispatcher correctly restarts event processing when interrupted by a signal. The test currently fails as this feature isn't implemented. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-01-22test: pipeline: IPU3: Add IPU3 pipeline testJacopo Mondi
Add test for the Intel IPU3 pipeline that lists all the cameras registered in the system and verifies the result matches the expected. This test is meant to be run on IPU3 platforms, it gets skipped otherwise. Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-01-17test: v4l2_device: Add test suite and initial testKieran Bingham
Provide a base class to construct a v4l2_device object for further tests and an initial test which validates the FD handle can not be leaked. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-01-08test: Add event notifier testLaurent Pinchart
The test covers read notification and notifier enable/disable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-01-08test: Add timer testLaurent Pinchart
The test covers timer start, timeout, restart after completion, restart before completion and multiple timers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-01-08test: Add signal/slot testLaurent Pinchart
The test covers signal connection, disconnection through all the provided methods, emission, parameters, and connection of a signal to multiple slots. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>