Skip to content

Commit 723d053

Browse files
mripardbebarino
authored andcommitted
clk: Introduce Kunit Tests for the framework
Let's test various parts of the rate-related clock API with the kunit testing framework. Cc: [email protected] Tested-by: Daniel Latypov <[email protected]> Suggested-by: Stephen Boyd <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 0c1b56d commit 723d053

File tree

4 files changed

+796
-0
lines changed

4 files changed

+796
-0
lines changed

drivers/clk/.kunitconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
CONFIG_KUNIT=y
22
CONFIG_COMMON_CLK=y
3+
CONFIG_CLK_KUNIT_TEST=y
34
CONFIG_CLK_GATE_KUNIT_TEST=y

drivers/clk/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ source "drivers/clk/xilinx/Kconfig"
429429
source "drivers/clk/zynqmp/Kconfig"
430430

431431
# Kunit test cases
432+
config CLK_KUNIT_TEST
433+
tristate "Basic Clock Framework Kunit Tests" if !KUNIT_ALL_TESTS
434+
depends on KUNIT
435+
default KUNIT_ALL_TESTS
436+
help
437+
Kunit tests for the common clock framework.
438+
432439
config CLK_GATE_KUNIT_TEST
433440
tristate "Basic gate type Kunit test" if !KUNIT_ALL_TESTS
434441
depends on KUNIT

drivers/clk/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# common clock types
33
obj-$(CONFIG_HAVE_CLK) += clk-devres.o clk-bulk.o clkdev.o
44
obj-$(CONFIG_COMMON_CLK) += clk.o
5+
obj-$(CONFIG_CLK_KUNIT_TEST) += clk_test.o
56
obj-$(CONFIG_COMMON_CLK) += clk-divider.o
67
obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
78
obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o

0 commit comments

Comments
 (0)