Skip to contentSkip to conversation

platform/chrome: kunit: make EC protocol tests independent

PATCH Applied Tzung-Bi Shih 3 participants 4 messages Oct 3, 2023 – Oct 11, 2023

Subsystems (2)
lore
Share & tools
lore

Tzung-Bi Shih

author maintainer
#0 lore raw

PATCH 1/1 platform/chrome: kunit: make EC protocol tests independent

Remove CONFIG_CROS_KUNIT and common code concept for ChromeOS Kunit but make it bundle to ChromeOS EC protocol tests.

---
 drivers/platform/chrome/Kconfig                             | 6 +++---
 drivers/platform/chrome/Makefile                            | 5 ++---
 drivers/platform/chrome/cros_ec_proto_test.c                | 2 +-
 .../chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} | 4 +---
 .../chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} | 0
 5 files changed, 7 insertions(+), 10 deletions(-)
 rename drivers/platform/chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} (98%)
 rename drivers/platform/chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} (100%)
drivers/platform/chrome/Kconfig +3 -3
index 7d82a0946e1c..7a83346bfa53 100644
@@ -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
drivers/platform/chrome/Makefile +2 -3
index 9e26e45c4a37..2dcc6ccc2302 100644
@@ -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
drivers/platform/chrome/cros_ec_proto_test.c +1 -1
index 5b9748e0463b..28f722396fc1 100644
@@ -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
 
drivers/platform/chrome/cros_ec_proto_test_util.c renamed from drivers/platform/chrome/cros_kunit_util.c +1 -3
similarity index 98%
rename from drivers/platform/chrome/cros_kunit_util.c
rename to drivers/platform/chrome/cros_ec_proto_test_util.c
index f0fda96b11bd..65d328bcd6eb 100644
@@ -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");
drivers/platform/chrome/cros_ec_proto_test_util.h renamed from drivers/platform/chrome/cros_kunit_util.h +0 -0
similarity index 100%
rename from drivers/platform/chrome/cros_kunit_util.h
rename to drivers/platform/chrome/cros_ec_proto_test_util.h
Signature · 1 line
2.42.0.582.g8ccd20d70d-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tzung-Bi Shih

Remove CONFIG_CROS_KUNIT and common code concept for ChromeOS Kunit but make it bundle to ChromeOS EC protocol tests.

Quoted 85 lines
---
 drivers/platform/chrome/Kconfig                             | 6 +++---
 drivers/platform/chrome/Makefile                            | 5 ++---
 drivers/platform/chrome/cros_ec_proto_test.c                | 2 +-
 .../chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} | 4 +---
 .../chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} | 0
 5 files changed, 7 insertions(+), 10 deletions(-)
 rename drivers/platform/chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} (98%)
 rename drivers/platform/chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} (100%)
drivers/platform/chrome/Kconfig +3 -3
index 7d82a0946e1c..7a83346bfa53 100644
@@ -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
drivers/platform/chrome/Makefile +2 -3
index 9e26e45c4a37..2dcc6ccc2302 100644
@@ -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
drivers/platform/chrome/cros_ec_proto_test.c +1 -1
index 5b9748e0463b..28f722396fc1 100644
@@ -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
 
drivers/platform/chrome/cros_ec_proto_test_util.c renamed from drivers/platform/chrome/cros_kunit_util.c +1 -3
similarity index 98%
rename from drivers/platform/chrome/cros_kunit_util.c
rename to drivers/platform/chrome/cros_ec_proto_test_util.c
index f0fda96b11bd..65d328bcd6eb 100644
@@ -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");
drivers/platform/chrome/cros_ec_proto_test_util.h renamed from drivers/platform/chrome/cros_kunit_util.h +0 -1
similarity index 100%
rename from drivers/platform/chrome/cros_kunit_util.h
rename to drivers/platform/chrome/cros_ec_proto_test_util.h
--

2.42.0.582.g8ccd20d70d-goog

#2 lore raw
In reply to Tzung-Bi Shih
This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Quoted 4 lines · On Tue, 3 Oct 2023 08:05:15 +0000 you wrote:

Remove CONFIG_CROS_KUNIT and common code concept for ChromeOS Kunit but make it bundle to ChromeOS EC protocol tests.

Quoted 9 lines
---
 drivers/platform/chrome/Kconfig                             | 6 +++---
 drivers/platform/chrome/Makefile                            | 5 ++---
 drivers/platform/chrome/cros_ec_proto_test.c                | 2 +-
 .../chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} | 4 +---
 .../chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} | 0
 5 files changed, 7 insertions(+), 10 deletions(-)
 rename drivers/platform/chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} (98%)
 rename drivers/platform/chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} (100%)

Here is the summary with links:
- platform/chrome: kunit: make EC protocol tests independent

    https://git.kernel.org/chrome-platform/c/466f70fb1b10

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Tzung-Bi Shih
This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Quoted 4 lines · On Tue, 3 Oct 2023 08:05:15 +0000 you wrote:

Remove CONFIG_CROS_KUNIT and common code concept for ChromeOS Kunit but make it bundle to ChromeOS EC protocol tests.

Quoted 9 lines
---
 drivers/platform/chrome/Kconfig                             | 6 +++---
 drivers/platform/chrome/Makefile                            | 5 ++---
 drivers/platform/chrome/cros_ec_proto_test.c                | 2 +-
 .../chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} | 4 +---
 .../chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} | 0
 5 files changed, 7 insertions(+), 10 deletions(-)
 rename drivers/platform/chrome/{cros_kunit_util.c => cros_ec_proto_test_util.c} (98%)
 rename drivers/platform/chrome/{cros_kunit_util.h => cros_ec_proto_test_util.h} (100%)

Here is the summary with links:
- platform/chrome: kunit: make EC protocol tests independent

    https://git.kernel.org/chrome-platform/c/466f70fb1b10

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html