Commit 723d0530 authored by Maxime Ripard's avatar Maxime Ripard Committed by Stephen Boyd
Browse files

clk: Introduce Kunit Tests for the framework



Let's test various parts of the rate-related clock API with the kunit
testing framework.

Cc: kunit-dev@googlegroups.com
Tested-by: default avatarDaniel Latypov <dlatypov@google.com>
Suggested-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220225143534.405820-3-maxime@cerno.tech


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 0c1b56df
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
CONFIG_KUNIT=y
CONFIG_COMMON_CLK=y
CONFIG_CLK_KUNIT_TEST=y
CONFIG_CLK_GATE_KUNIT_TEST=y
+7 −0
Original line number Diff line number Diff line
@@ -429,6 +429,13 @@ source "drivers/clk/xilinx/Kconfig"
source "drivers/clk/zynqmp/Kconfig"

# Kunit test cases
config CLK_KUNIT_TEST
	tristate "Basic Clock Framework Kunit Tests" if !KUNIT_ALL_TESTS
	depends on KUNIT
	default KUNIT_ALL_TESTS
	help
	  Kunit tests for the common clock framework.

config CLK_GATE_KUNIT_TEST
	tristate "Basic gate type Kunit test" if !KUNIT_ALL_TESTS
	depends on KUNIT
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
# common clock types
obj-$(CONFIG_HAVE_CLK)		+= clk-devres.o clk-bulk.o clkdev.o
obj-$(CONFIG_COMMON_CLK)	+= clk.o
obj-$(CONFIG_CLK_KUNIT_TEST)	+= clk_test.o
obj-$(CONFIG_COMMON_CLK)	+= clk-divider.o
obj-$(CONFIG_COMMON_CLK)	+= clk-fixed-factor.o
obj-$(CONFIG_COMMON_CLK)	+= clk-fixed-rate.o

drivers/clk/clk_test.c

0 → 100644
+787 −0

File added.

Preview size limit exceeded, changes collapsed.