This patch set introduces a KUnit suite to test the core components of the FPGA subsystem. More specifically, the suite tests the core functions of the FPGA manager, FPGA bridge, and FPGA region. These components are tested using "fake" modules that allow observing their internals without altering the source code. The test suite can be run using [user@localhost linux]$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/fpga/tests Marco Pagani (4): fpga: add initial KUnit test suite fpga: add fake FPGA region fpga: add fake FPGA manager fpga: add fake FPGA bridge drivers/fpga/Kconfig | 2 + drivers/fpga/Makefile | 3 + drivers/fpga/tests/.kunitconfig | 5 + drivers/fpga/tests/Kconfig | 15 ++ drivers/fpga/tests/Makefile | 6 + drivers/fpga/tests/fake-fpga-bridge.c | 214 +++++++++++++++ drivers/fpga/tests/fake-fpga-bridge.h | 36 +++ drivers/fpga/tests/fake-fpga-mgr.c | 365 ++++++++++++++++++++++++++ drivers/fpga/tests/fake-fpga-mgr.h | 42 +++ drivers/fpga/tests/fake-fpga-region.c | 186 +++++++++++++ drivers/fpga/tests/fake-fpga-region.h | 37 +++ drivers/fpga/tests/fpga-tests.c | 264 +++++++++++++++++++ 12 files changed, 1175 insertions(+) create mode 100644 drivers/fpga/tests/.kunitconfig create mode 100644 drivers/fpga/tests/Kconfig create mode 100644 drivers/fpga/tests/Makefile create mode 100644 drivers/fpga/tests/fake-fpga-bridge.c create mode 100644 drivers/fpga/tests/fake-fpga-bridge.h create mode 100644 drivers/fpga/tests/fake-fpga-mgr.c create mode 100644 drivers/fpga/tests/fake-fpga-mgr.h create mode 100644 drivers/fpga/tests/fake-fpga-region.c create mode 100644 drivers/fpga/tests/fake-fpga-region.h create mode 100644 drivers/fpga/tests/fpga-tests.c -- 2.39.1