commit | b5ec656d59857799b3cf17583e5ecb414afac0d0 | [log] [tgz] |
---|---|---|
author | Gwendal Grignou <gwendal@chromium.org> | Thu Nov 02 16:47:51 2023 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Dec 04 09:37:27 2023 |
tree | aebc95070304a2914d360ca8cecb08c208c823c5 | |
parent | c6b395f9818c82504728767475cbb70846f23f06 [diff] |
libmems: Mark libmems_test_support as test library Following https://chromium.googlesource.com/chromiumos/docs/+/HEAD/testing/unit_tests.md#exclude-unit-test-files-from-the-os-image Install the test library in /build/lib. BUG=b:285404429, b:306363846 TEST=CQ Change-Id: I06121c1aa5943ee0174b46053565c4a4dd64095f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/5001701 Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> NOKEYCHECK=True GitOrigin-RevId: 4012366a8bf755727f15e1ea80093d71ff126532
Project goal and motivation
This library provides a set of wrapper and test helpers around libiio.
It is meant to provide a common foundation for Chrome OS to access and interface IIO sensors, with:
At the root of the hierarchy, there exists the IioContext
, which represents the IIO devices currently available on the system. These can be retrieved by name and inspected, via instances of IioDevice
.
An IioDevice
allows reading and writing attributes of an IIO device via type-safe helper APIs. It also offers support for configuring the buffer and trigger of an IIO device, which we use in order to allow the Chrome UI to read accelerometer data and support screen rotation.
An IioDevice
also exposes a list of IioChannel
s, which can individually be enabled and disabled.
Useful mocks for the core classes are provided, such that a test author can focus on the logic of the unit tests and share a common testing language with other engineers working in this space. Sharing the foundation of testing IIO sensor access helps ensure that any improvement in this area can benefit all clients.