linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v5 0/4] fpga: add initial KUnit tests for the subsystem
@ 2023-05-11 14:19 Marco Pagani
  2023-05-11 14:19 ` [RFC PATCH v5 1/4] fpga: add fake FPGA manager Marco Pagani
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Marco Pagani @ 2023-05-11 14:19 UTC (permalink / raw)
  To: Moritz Fischer, Wu Hao, Xu Yilun, Tom Rix
  Cc: Marco Pagani, linux-kernel, linux-fpga

This patch set introduces initial KUnit test suites for the FPGA subsystem.

Tests can be run using:
[user@localhost linux]$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/fpga/tests

v5:
- Removed most of the exported functions from fake components
- Moved all KUnit expectations/assertions to the main test module
- Removed standalone use case to simplify the code
- Removed instances counters from fake components (using device.id instead)
- Set header size in the .parse_header op
- improved bridge get_put_list test case

v4:
- Fix build error

v3:
- Calling fpga_bridges_put() between reconfigurations
- Functions for registering fake modules allocate and return context structs

v2:
- Restructured code into multiple suites to test components in isolation
- Reduced code duplication using init and exit methods
- Using a get_bridges() method to build the list of bridges just before programming
- Regions and Bridges are organized topologically
- Changed bitstream/bit to images
- Allocate images dynamically
- Renamed fpga-tests to fpga-test
- Simplified Kconfig
- Add license info to the fpga-test module

Marco Pagani (4):
  fpga: add fake FPGA manager
  fpga: add fake FPGA bridge
  fpga: add fake FPGA region
  fpga: add initial KUnit test suites

 drivers/fpga/Kconfig                  |   2 +
 drivers/fpga/Makefile                 |   3 +
 drivers/fpga/tests/.kunitconfig       |   5 +
 drivers/fpga/tests/Kconfig            |  11 +
 drivers/fpga/tests/Makefile           |   6 +
 drivers/fpga/tests/fake-fpga-bridge.c | 203 ++++++++++
 drivers/fpga/tests/fake-fpga-bridge.h |  40 ++
 drivers/fpga/tests/fake-fpga-mgr.c    | 271 +++++++++++++
 drivers/fpga/tests/fake-fpga-mgr.h    |  53 +++
 drivers/fpga/tests/fake-fpga-region.c | 245 ++++++++++++
 drivers/fpga/tests/fake-fpga-region.h |  40 ++
 drivers/fpga/tests/fpga-test.c        | 551 ++++++++++++++++++++++++++
 12 files changed, 1430 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-test.c


base-commit: ac9a78681b921877518763ba0e89202254349d1b
-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-05-18 12:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-11 14:19 [RFC PATCH v5 0/4] fpga: add initial KUnit tests for the subsystem Marco Pagani
2023-05-11 14:19 ` [RFC PATCH v5 1/4] fpga: add fake FPGA manager Marco Pagani
2023-05-13 15:44   ` Xu Yilun
2023-05-11 14:19 ` [RFC PATCH v5 2/4] fpga: add fake FPGA bridge Marco Pagani
2023-05-13 15:46   ` Xu Yilun
2023-05-11 14:19 ` [RFC PATCH v5 3/4] fpga: add fake FPGA region Marco Pagani
2023-05-13 16:05   ` Xu Yilun
2023-05-11 14:19 ` [RFC PATCH v5 4/4] fpga: add initial KUnit test suites Marco Pagani
2023-05-13 17:40   ` Xu Yilun
2023-05-15 17:24     ` Marco Pagani
2023-05-17 10:04       ` Xu Yilun
2023-05-18 12:43         ` Marco Pagani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).