[libgpiod,0/3] tests: add support for the gpio-sim kernel module

Message ID 20210429094734.9585-1-brgl@bgdev.pl
Headers show
  • tests: add support for the gpio-sim kernel module
Related show


Bartosz Golaszewski April 29, 2021, 9:47 a.m.
This series implements user-space support for the gpio-sim kernel module
and ports the core C tests to using it. The goal is to entirely drop support
for gpio-mockup from libgpiod.

The new library is designed in a way that allows multiple test suites to run
at the same time as any process using the library only ever interacts with the
simulated chips it instantiated itself. The new kernel driver also doesn't
require the user to unload the module to change the chip setup.

The first patch removes leftover code. The second adds the new library and
the last one does the porting of the core code.

In the future - once v2 for language bindings is done, we'll port other
test-suites to the new library.

Bartosz Golaszewski (3):
  tests: remove gpiod_test_chip_num()
  libgpiosim: new library for controlling the gpio-sim module
  tests: port C tests to libgpiosim

 configure.ac                     |   5 +-
 tests/Makefile.am                |   6 +-
 tests/gpiod-test.c               | 134 ++++--
 tests/gpiod-test.h               |   3 +-
 tests/gpiosim/.gitignore         |   4 +
 tests/gpiosim/Makefile.am        |  16 +
 tests/gpiosim/gpiosim-selftest.c | 103 +++++
 tests/gpiosim/gpiosim.c          | 743 +++++++++++++++++++++++++++++++
 tests/gpiosim/gpiosim.h          |  42 ++
 9 files changed, 1012 insertions(+), 44 deletions(-)
 create mode 100644 tests/gpiosim/.gitignore
 create mode 100644 tests/gpiosim/Makefile.am
 create mode 100644 tests/gpiosim/gpiosim-selftest.c
 create mode 100644 tests/gpiosim/gpiosim.c
 create mode 100644 tests/gpiosim/gpiosim.h