On 1/2/21 3:59 PM, Lars-Peter Clausen wrote:
On 12/29/20 7:16 PM, Jonathan Cameron wrote:
On Tue, 15 Dec 2020 20:17:43 +0100
Lars-Peter Clausen <lars@xxxxxxxxxx> wrote:
The IIO core provides a function to do formatting of fixedpoint
numbers.
In the past there have been some issues with the implementation of the
function where for example negative numbers were not handled correctly.
Introduce a basic unit test based on kunit that tests the function and
ensures that the generated output matches the expected output.
This gives us some confidence that future modifications to the function
implementation will not break ABI compatibility.
To run the unit tests follow the kunit documentation and add
CONFIG_IIO=y
CONFIG_IIO_TEST_FORMAT=y
to the .kunitconfig and run
> ./tools/testing/kunit/kunit.py run
Configuring KUnit Kernel ...
Building KUnit Kernel ...
Starting KUnit Kernel ...
============================================================
======== [PASSED] iio-format ========
[PASSED] iio_test_iio_format_value_integer
[PASSED] iio_test_iio_format_value_fixedpoint
[PASSED] iio_test_iio_format_value_fractional
[PASSED] iio_test_iio_format_value_fractional_log2
[PASSED] iio_test_iio_format_value_multiple
============================================================
Testing complete. 21 tests run. 0 failed. 0 crashed.
Elapsed time: 8.242s total, 0.001s configuring, 3.865s building,
0.000s running
Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
Series looks good to me, but I wonder. What is convention wrt to
MAINTAINERS / Acks etc for self tests?
Let's ask Brendan.
Jonathan, since there hasn't been any additional feedback should we just
apply this series?
Thanks,
- Lars