summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhurima Paruchuri <mparuchuri@google.com>2023-03-09 07:20:59 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-14 15:41:05 +0000
commit6fc59923d8f0542c2b19c0cbf6bd4089c2c126b7 (patch)
tree90a75e1e24f3aac012030481e672b216f44b85e7
parentea954822af314766381b8ebda6abd9eb432dcb36 (diff)
downloadchrome-ec-6fc59923d8f0542c2b19c0cbf6bd4089c2c126b7.tar.gz
rex: test: fan: Refactor FFF declaration and DTC overlay config
Use FAKE_VALUE_FUNC inplace of DECLARE_FAKE_VALUE_FUNC and DEFINE_FAKE_VALUE_FUNC, as both of them are called from same file Use FAKE_VOID_FUNC inplace of DECLARE_FAKE_VOID_FUNC and DEFINE_FAKE_VOID_FUNC, as both of them are called from same file Use new YAML DTC overlay config field inplace of extra_args to configure device tree files to be used during testing BRANCH=none BUG=none TEST=./twister -s rex/rex.fan -c Change-Id: I44b3d2998eea33ae1f83c4af1d2d8cf5c2f843e3 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4323339 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
-rw-r--r--zephyr/test/rex/src/fan.c9
-rw-r--r--zephyr/test/rex/testcase.yaml4
2 files changed, 6 insertions, 7 deletions
diff --git a/zephyr/test/rex/src/fan.c b/zephyr/test/rex/src/fan.c
index eb918a4369..7978475a76 100644
--- a/zephyr/test/rex/src/fan.c
+++ b/zephyr/test/rex/src/fan.c
@@ -10,12 +10,9 @@
#include <zephyr/fff.h>
#include <zephyr/ztest.h>
-DECLARE_FAKE_VALUE_FUNC(int, cros_cbi_get_fw_config,
- enum cbi_fw_config_field_id, uint32_t *);
-DEFINE_FAKE_VALUE_FUNC(int, cros_cbi_get_fw_config, enum cbi_fw_config_field_id,
- uint32_t *);
-DECLARE_FAKE_VOID_FUNC(fan_set_count, int);
-DEFINE_FAKE_VOID_FUNC(fan_set_count, int);
+FAKE_VALUE_FUNC(int, cros_cbi_get_fw_config, enum cbi_fw_config_field_id,
+ uint32_t *);
+FAKE_VOID_FUNC(fan_set_count, int);
int cros_cbi_get_fw_config_mock(enum cbi_fw_config_field_id field_id,
uint32_t *value)
diff --git a/zephyr/test/rex/testcase.yaml b/zephyr/test/rex/testcase.yaml
index d55ad64080..64b5904f57 100644
--- a/zephyr/test/rex/testcase.yaml
+++ b/zephyr/test/rex/testcase.yaml
@@ -12,7 +12,9 @@ tests:
- CONFIG_TEST_ENABLE_USB_PD_HOST_CMD=y
rex.fan:
- extra_args: DTC_OVERLAY_FILE="boards/native_posix.overlay;fan.dtsi"
+ extra_dtc_overlay_files:
+ - boards/native_posix.overlay
+ - fan.dtsi
extra_configs:
- CONFIG_TEST_FAN=y