summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/test_util.h6
-rw-r--r--test/cbi.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/include/test_util.h b/include/test_util.h
index ff2c99d950..a4daaf7f87 100644
--- a/include/test_util.h
+++ b/include/test_util.h
@@ -359,6 +359,10 @@ int test_attach_i2c(const int port, const uint16_t addr_flags);
* This macro uses the lowest common denominator of the two (Zephyr) so tests
* that migrate from platform/ec to Zephyr will no longer be able to use the
* arguments (compile time checked).
+ * TEST_SUITE(name) macro is resolved to TEST_MAIN in platform/ec tests.
+ * In Zephyr tests it allows to use different name for entry point than
+ * test_main(void). Because of that, it is possible to combine multiple test
+ * suites in one test.
*
* Usage:
* TEST_MAIN()
@@ -368,6 +372,7 @@ int test_attach_i2c(const int port, const uint16_t addr_flags);
*/
#ifdef CONFIG_ZEPHYR
#define TEST_MAIN() void test_main(void)
+#define TEST_SUITE(name) void name(void)
#else
#define TEST_MAIN() \
void test_main(void); \
@@ -378,6 +383,7 @@ int test_attach_i2c(const int port, const uint16_t addr_flags);
test_print_result(); \
} \
void test_main(void)
+#define TEST_SUITE(name) TEST_MAIN()
#endif
/*
diff --git a/test/cbi.c b/test/cbi.c
index 2096ebce5a..222128ce8d 100644
--- a/test/cbi.c
+++ b/test/cbi.c
@@ -268,7 +268,7 @@ DECLARE_EC_TEST(test_bad_crc)
return EC_SUCCESS;
}
-TEST_MAIN()
+TEST_SUITE(test_suite_cbi)
{
ztest_test_suite(test_cbi,
ztest_unit_test_setup_teardown(test_uint8, test_setup,