]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/chrome: kunit: make EC protocol tests independent
authorTzung-Bi Shih <tzungbi@kernel.org>
Tue, 3 Oct 2023 08:05:15 +0000 (08:05 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Thu, 5 Oct 2023 10:11:36 +0000 (18:11 +0800)
Remove CONFIG_CROS_KUNIT and common code concept for ChromeOS Kunit but
make it bundle to ChromeOS EC protocol tests.

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20231003080515.4011374-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/Kconfig
drivers/platform/chrome/Makefile
drivers/platform/chrome/cros_ec_proto_test.c
drivers/platform/chrome/cros_ec_proto_test_util.c [moved from drivers/platform/chrome/cros_kunit_util.c with 98% similarity]
drivers/platform/chrome/cros_ec_proto_test_util.h [moved from drivers/platform/chrome/cros_kunit_util.h with 100% similarity]

index 7d82a0946e1c8beccb058d13e92d773764c65796..7a83346bfa53d5346ab3cdaa57669883ea31ed8f 100644 (file)
@@ -299,12 +299,12 @@ config CROS_TYPEC_SWITCH
 source "drivers/platform/chrome/wilco_ec/Kconfig"
 
 # Kunit test cases
-config CROS_KUNIT
-       tristate "Kunit tests for ChromeOS" if !KUNIT_ALL_TESTS
+config CROS_KUNIT_EC_PROTO_TEST
+       tristate "Kunit tests for ChromeOS EC protocol" if !KUNIT_ALL_TESTS
        depends on KUNIT && CROS_EC
        default KUNIT_ALL_TESTS
        select CROS_EC_PROTO
        help
-         ChromeOS Kunit tests.
+         Kunit tests for ChromeOS EC protocol.
 
 endif # CHROMEOS_PLATFORMS
index 9e26e45c4a375882e3de36ae4c6b5d62d8d6abb9..2dcc6ccc23022b18f2743b786ac4535d1b435e0e 100644 (file)
@@ -36,6 +36,5 @@ obj-$(CONFIG_CROS_USBPD_NOTIFY)               += cros_usbpd_notify.o
 obj-$(CONFIG_WILCO_EC)                 += wilco_ec/
 
 # Kunit test cases
-obj-$(CONFIG_CROS_KUNIT)               += cros_kunit.o
-cros_kunit-objs                                := cros_kunit_util.o
-cros_kunit-objs                                += cros_ec_proto_test.o
+obj-$(CONFIG_CROS_KUNIT_EC_PROTO_TEST) += cros_kunit_proto_test.o
+cros_kunit_proto_test-objs             := cros_ec_proto_test_util.o cros_ec_proto_test.o
index 63e38671e95a648a3aba1c01a68ed40a084a1d6c..b6169d6f2467775040c5486eafb480b964395ce4 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/platform_data/cros_ec_proto.h>
 
 #include "cros_ec.h"
-#include "cros_kunit_util.h"
+#include "cros_ec_proto_test_util.h"
 
 #define BUFSIZE 512
 
similarity index 98%
rename from drivers/platform/chrome/cros_kunit_util.c
rename to drivers/platform/chrome/cros_ec_proto_test_util.c
index f0fda96b11bd567094712f7548606c3f58d8fa49..65d328bcd6eb2d77ce4db845b3c6c39269d46622 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/platform_data/cros_ec_proto.h>
 
 #include "cros_ec.h"
-#include "cros_kunit_util.h"
+#include "cros_ec_proto_test_util.h"
 
 int cros_kunit_ec_xfer_mock_default_result;
 int cros_kunit_ec_xfer_mock_default_ret;
@@ -126,5 +126,3 @@ void cros_kunit_mock_reset(void)
        cros_kunit_readmem_mock_data = NULL;
        cros_kunit_readmem_mock_ret = 0;
 }
-
-MODULE_LICENSE("GPL");