Skip to content

Commit a992acb

Browse files
committed
clk: gate: Add some kunit test suites
Test various parts of the clk gate implementation with the kunit testing framework. Reviewed-by: Brendan Higgins <[email protected]> Acked-by: Daniel Latypov <[email protected]> Cc: <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e783362 commit a992acb

File tree

4 files changed

+476
-0
lines changed

4 files changed

+476
-0
lines changed

drivers/clk/.kunitconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_KUNIT=y
2+
CONFIG_COMMON_CLK=y
3+
CONFIG_CLK_GATE_KUNIT_TEST=y

drivers/clk/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,4 +428,12 @@ source "drivers/clk/x86/Kconfig"
428428
source "drivers/clk/xilinx/Kconfig"
429429
source "drivers/clk/zynqmp/Kconfig"
430430

431+
# Kunit test cases
432+
config CLK_GATE_KUNIT_TEST
433+
tristate "Basic gate type Kunit test" if !KUNIT_ALL_TESTS
434+
depends on KUNIT
435+
default KUNIT_ALL_TESTS
436+
help
437+
Kunit test for the basic clk gate type.
438+
431439
endif

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-divider.o
66
obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
77
obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o
88
obj-$(CONFIG_COMMON_CLK) += clk-gate.o
9+
obj-$(CONFIG_CLK_GATE_KUNIT_TEST) += clk-gate_test.o
910
obj-$(CONFIG_COMMON_CLK) += clk-multiplier.o
1011
obj-$(CONFIG_COMMON_CLK) += clk-mux.o
1112
obj-$(CONFIG_COMMON_CLK) += clk-composite.o

0 commit comments

Comments
 (0)