Skip to content

Commit

Permalink
clk: Introduce Kunit Tests for the framework
Browse files Browse the repository at this point in the history
Let's test various parts of the rate-related clock API with the kunit
testing framework.

Cc: kunit-dev@googlegroups.com
Tested-by: Daniel Latypov <dlatypov@google.com>
Suggested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220225143534.405820-3-maxime@cerno.tech
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Maxime Ripard authored and Stephen Boyd committed Mar 12, 2022
1 parent 0c1b56d commit 723d053
Show file tree
Hide file tree
Showing 4 changed files with 796 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/.kunitconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_KUNIT=y
CONFIG_COMMON_CLK=y
CONFIG_CLK_KUNIT_TEST=y
CONFIG_CLK_GATE_KUNIT_TEST=y
7 changes: 7 additions & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 723d053

Please sign in to comment.