Anastasia Klimchuk submitted this change.
tests: Rename run_lifecycle into run_basic_lifecycle
Lifecycle tests are getting an upgrade in this chain, with new type
of tests: lifecycle with probing. Existing lifecycle, being the
simplest possible one becomes "basic lifecycle".
With time, most of existing tests will be upgraded to probing
lifecycle, however not necessarily all of them. Basic lifecycle will
likely to stay as an option. This can be convenient, for a developer
who wishes to add a test for a programmer, to have a choice of basic
and extended option.
BUG=b:181803212
TEST=ninja test
Change-Id: I2771921ae2bd37f4b3f49342e03d9abb5ee36ea0
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/59740
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
---
M tests/lifecycle.c
M tests/tests.c
M tests/tests.h
3 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/tests/lifecycle.c b/tests/lifecycle.c
index 2a8d6f5..8cb604b 100644
--- a/tests/lifecycle.c
+++ b/tests/lifecycle.c
@@ -19,7 +19,7 @@
#include "io_mock.h"
#include "programmer.h"
-static void run_lifecycle(void **state, const struct programmer_entry *prog, const char *param)
+static void run_basic_lifecycle(void **state, const struct programmer_entry *prog, const char *param)
{
(void) state; /* unused */
@@ -36,19 +36,19 @@
free(param_dup);
}
-void dummy_init_and_shutdown_test_success(void **state)
+void dummy_basic_lifecycle_test_success(void **state)
{
#if CONFIG_DUMMY == 1
- run_lifecycle(state, &programmer_dummy, "bus=parallel+lpc+fwh+spi");
+ run_basic_lifecycle(state, &programmer_dummy, "bus=parallel+lpc+fwh+spi");
#else
skip();
#endif
}
-void nicrealtek_init_and_shutdown_test_success(void **state)
+void nicrealtek_basic_lifecycle_test_success(void **state)
{
#if CONFIG_NICREALTEK == 1
- run_lifecycle(state, &programmer_nicrealtek, "");
+ run_basic_lifecycle(state, &programmer_nicrealtek, "");
#else
skip();
#endif
@@ -122,7 +122,7 @@
free(config);
}
-void raiden_debug_init_and_shutdown_test_success(void **state)
+void raiden_debug_basic_lifecycle_test_success(void **state)
{
#if CONFIG_RAIDEN_DEBUG_SPI == 1
const struct io_mock raiden_debug_io = {
@@ -142,7 +142,7 @@
io_mock_register(&raiden_debug_io);
- run_lifecycle(state, &programmer_raiden_debug_spi, raiden_debug_param);
+ run_basic_lifecycle(state, &programmer_raiden_debug_spi, raiden_debug_param);
io_mock_register(NULL);
#else
@@ -173,7 +173,7 @@
return wLength;
}
-void dediprog_init_and_shutdown_test_success(void **state)
+void dediprog_basic_lifecycle_test_success(void **state)
{
#if CONFIG_DEDIPROG == 1
const struct io_mock dediprog_io = {
@@ -183,7 +183,7 @@
io_mock_register(&dediprog_io);
- run_lifecycle(state, &programmer_dediprog, "voltage=3.5V");
+ run_basic_lifecycle(state, &programmer_dediprog, "voltage=3.5V");
io_mock_register(NULL);
#else
@@ -247,7 +247,7 @@
return 0;
}
-void linux_mtd_init_and_shutdown_test_success(void **state)
+void linux_mtd_basic_lifecycle_test_success(void **state)
{
#if CONFIG_LINUX_MTD == 1
struct linux_mtd_io_state linux_mtd_io_state = { NULL };
@@ -260,7 +260,7 @@
io_mock_register(&linux_mtd_io);
- run_lifecycle(state, &programmer_linux_mtd, "");
+ run_basic_lifecycle(state, &programmer_linux_mtd, "");
io_mock_register(NULL);
#else
@@ -276,7 +276,7 @@
return memcpy(buf, max_buf_size, min(len, strlen(max_buf_size) + 1));
}
-void linux_spi_init_and_shutdown_test_success(void **state)
+void linux_spi_basic_lifecycle_test_success(void **state)
{
/*
* Current implementation tests a particular path of the init procedure.
@@ -289,7 +289,7 @@
io_mock_register(&linux_spi_io);
- run_lifecycle(state, &programmer_linux_spi, "dev=/dev/null");
+ run_basic_lifecycle(state, &programmer_linux_spi, "dev=/dev/null");
io_mock_register(NULL);
#else
@@ -332,7 +332,7 @@
return sz;
}
-void realtek_mst_init_and_shutdown_test_success(void **state)
+void realtek_mst_basic_lifecycle_test_success(void **state)
{
#if CONFIG_REALTEK_MST_I2C_SPI == 1
const struct io_mock realtek_mst_io = {
@@ -343,7 +343,7 @@
};
io_mock_register(&realtek_mst_io);
- run_lifecycle(state, &programmer_realtek_mst_i2c_spi, "bus=254,enter-isp=0");
+ run_basic_lifecycle(state, &programmer_realtek_mst_i2c_spi, "bus=254,enter-isp=0");
io_mock_register(NULL);
#else
diff --git a/tests/tests.c b/tests/tests.c
index 74a4f57..21cc1ed 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -363,13 +363,13 @@
ret |= cmocka_run_group_tests_name("spi25.c tests", spi25_tests, NULL, NULL);
const struct CMUnitTest lifecycle_tests[] = {
- cmocka_unit_test(dummy_init_and_shutdown_test_success),
- cmocka_unit_test(nicrealtek_init_and_shutdown_test_success),
- cmocka_unit_test(raiden_debug_init_and_shutdown_test_success),
- cmocka_unit_test(dediprog_init_and_shutdown_test_success),
- cmocka_unit_test(linux_mtd_init_and_shutdown_test_success),
- cmocka_unit_test(linux_spi_init_and_shutdown_test_success),
- cmocka_unit_test(realtek_mst_init_and_shutdown_test_success),
+ cmocka_unit_test(dummy_basic_lifecycle_test_success),
+ cmocka_unit_test(nicrealtek_basic_lifecycle_test_success),
+ cmocka_unit_test(raiden_debug_basic_lifecycle_test_success),
+ cmocka_unit_test(dediprog_basic_lifecycle_test_success),
+ cmocka_unit_test(linux_mtd_basic_lifecycle_test_success),
+ cmocka_unit_test(linux_spi_basic_lifecycle_test_success),
+ cmocka_unit_test(realtek_mst_basic_lifecycle_test_success),
};
ret |= cmocka_run_group_tests_name("lifecycle.c tests", lifecycle_tests, NULL, NULL);
diff --git a/tests/tests.h b/tests/tests.h
index 5480beb..1218a30 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -41,13 +41,13 @@
void probe_spi_st95_test_success(void **state); /* spi95.c */
/* lifecycle.c */
-void dummy_init_and_shutdown_test_success(void **state);
-void nicrealtek_init_and_shutdown_test_success(void **state);
-void raiden_debug_init_and_shutdown_test_success(void **state);
-void dediprog_init_and_shutdown_test_success(void **state);
-void linux_mtd_init_and_shutdown_test_success(void **state);
-void linux_spi_init_and_shutdown_test_success(void **state);
-void realtek_mst_init_and_shutdown_test_success(void **state);
+void dummy_basic_lifecycle_test_success(void **state);
+void nicrealtek_basic_lifecycle_test_success(void **state);
+void raiden_debug_basic_lifecycle_test_success(void **state);
+void dediprog_basic_lifecycle_test_success(void **state);
+void linux_mtd_basic_lifecycle_test_success(void **state);
+void linux_spi_basic_lifecycle_test_success(void **state);
+void realtek_mst_basic_lifecycle_test_success(void **state);
/* layout.c */
void included_regions_dont_overlap_test_success(void **state);
To view, visit change 59740. To unsubscribe, or for help writing mail filters, visit settings.