From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 10/23] test: log: Give tests names instead of numbers
Date: Sat, 17 Oct 2020 14:07:35 -0400 [thread overview]
Message-ID: <20201017180749.119271-11-seanga2@gmail.com> (raw)
In-Reply-To: <20201017180749.119271-1-seanga2@gmail.com>
Now that the log test command is no more, we can give the log tests proper
names.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
Changes in v3:
- New
test/log/log_test.c | 48 ++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/test/log/log_test.c b/test/log/log_test.c
index c5ca6dcb7a..4ac378fdad 100644
--- a/test/log/log_test.c
+++ b/test/log/log_test.c
@@ -72,7 +72,7 @@ static int do_check_log_entries(struct unit_test_state *uts, int flags, int min,
#define check_log_entries_none() check_log_entries_flags(0)
/* Check a category filter using the first category */
-int log_test_00(struct unit_test_state *uts)
+int log_test_cat_allow(struct unit_test_state *uts)
{
enum log_category_t cat_list[] = {
log_uc_cat(UCLASS_MMC), log_uc_cat(UCLASS_SPI),
@@ -94,10 +94,10 @@ int log_test_00(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt));
return 0;
}
-LOG_TEST_FLAGS(log_test_00, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_cat_allow, UT_TESTF_CONSOLE_REC);
/* Check a category filter that should block log entries */
-int log_test_02(struct unit_test_state *uts)
+int log_test_cat_deny_implicit(struct unit_test_state *uts)
{
enum log_category_t cat_list[] = {
log_uc_cat(UCLASS_MMC), LOGC_NONE, LOGC_END
@@ -114,10 +114,10 @@ int log_test_02(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt));
return 0;
}
-LOG_TEST_FLAGS(log_test_02, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_cat_deny_implicit, UT_TESTF_CONSOLE_REC);
/* Check passing and failing file filters */
-int log_test_03(struct unit_test_state *uts)
+int log_test_file(struct unit_test_state *uts)
{
int filt;
@@ -135,10 +135,10 @@ int log_test_03(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt));
return 0;
}
-LOG_TEST_FLAGS(log_test_03, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_file, UT_TESTF_CONSOLE_REC);
/* Check a passing file filter (second in list) */
-int log_test_05(struct unit_test_state *uts)
+int log_test_file_second(struct unit_test_state *uts)
{
int filt;
@@ -152,10 +152,10 @@ int log_test_05(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt));
return 0;
}
-LOG_TEST_FLAGS(log_test_05, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_file_second, UT_TESTF_CONSOLE_REC);
/* Check a passing file filter (middle of list) */
-int log_test_06(struct unit_test_state *uts)
+int log_test_file_mid(struct unit_test_state *uts)
{
int filt;
@@ -170,10 +170,10 @@ int log_test_06(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt));
return 0;
}
-LOG_TEST_FLAGS(log_test_06, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_file_mid, UT_TESTF_CONSOLE_REC);
/* Check a log level filter */
-int log_test_07(struct unit_test_state *uts)
+int log_test_level(struct unit_test_state *uts)
{
int filt;
@@ -188,10 +188,10 @@ int log_test_07(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt));
return 0;
}
-LOG_TEST_FLAGS(log_test_07, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_level, UT_TESTF_CONSOLE_REC);
/* Check two filters, one of which passes everything */
-int log_test_08(struct unit_test_state *uts)
+int log_test_double(struct unit_test_state *uts)
{
int filt1, filt2;
@@ -208,10 +208,10 @@ int log_test_08(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt2));
return 0;
}
-LOG_TEST_FLAGS(log_test_08, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_double, UT_TESTF_CONSOLE_REC);
/* Check three filters, which together pass everything */
-int log_test_09(struct unit_test_state *uts)
+int log_test_triple(struct unit_test_state *uts)
{
int filt1, filt2, filt3;
@@ -231,9 +231,9 @@ int log_test_09(struct unit_test_state *uts)
ut_assertok(log_remove_filter("console", filt3));
return 0;
}
-LOG_TEST_FLAGS(log_test_09, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_triple, UT_TESTF_CONSOLE_REC);
-int do_log_test_10(struct unit_test_state *uts)
+int do_log_test_helpers(struct unit_test_state *uts)
{
int i;
@@ -255,18 +255,18 @@ int do_log_test_10(struct unit_test_state *uts)
return 0;
}
-int log_test_10(struct unit_test_state *uts)
+int log_test_helpers(struct unit_test_state *uts)
{
int ret;
gd->log_fmt = LOGF_TEST;
- ret = do_log_test_10(uts);
+ ret = do_log_test_helpers(uts);
gd->log_fmt = log_get_default_format();
return ret;
}
-LOG_TEST_FLAGS(log_test_10, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_helpers, UT_TESTF_CONSOLE_REC);
-int do_log_test_11(struct unit_test_state *uts)
+int do_log_test_disable(struct unit_test_state *uts)
{
ut_assertok(console_record_reset_enable());
log_err("default\n");
@@ -282,13 +282,13 @@ int do_log_test_11(struct unit_test_state *uts)
return 0;
}
-int log_test_11(struct unit_test_state *uts)
+int log_test_disable(struct unit_test_state *uts)
{
int ret;
gd->log_fmt = LOGF_TEST;
- ret = do_log_test_10(uts);
+ ret = do_log_test_disable(uts);
gd->log_fmt = log_get_default_format();
return ret;
}
-LOG_TEST_FLAGS(log_test_11, UT_TESTF_CONSOLE_REC);
+LOG_TEST_FLAGS(log_test_disable, UT_TESTF_CONSOLE_REC);
--
2.28.0
next prev parent reply other threads:[~2020-10-17 18:07 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-17 18:07 [PATCH v3 00/23] log: Add commands for manipulating filters Sean Anderson
2020-10-17 18:07 ` [PATCH v3 01/23] log: Fix missing negation of ENOMEM Sean Anderson
2020-10-17 18:07 ` [PATCH v3 02/23] log: Fix incorrect documentation of log_filter.cat_list Sean Anderson
2020-10-17 18:07 ` [PATCH v3 03/23] log: Add additional const qualifier to arrays Sean Anderson
2020-10-17 18:07 ` [PATCH v3 04/23] log: Add new category names to log_cat_name Sean Anderson
2020-10-27 17:45 ` Tom Rini
2020-10-27 18:07 ` Sean Anderson
2020-10-27 18:08 ` Tom Rini
2020-10-17 18:07 ` [PATCH v3 05/23] log: Use CONFIG_IS_ENABLED() for LOG_TEST Sean Anderson
2020-10-17 18:07 ` [PATCH v3 06/23] log: Expose some helper functions Sean Anderson
2020-10-17 18:07 ` [PATCH v3 07/23] log: Add function to create a filter with flags Sean Anderson
2020-10-17 18:07 ` [PATCH v3 08/23] log: Add filter flag to deny on match Sean Anderson
2020-10-17 18:07 ` [PATCH v3 09/23] test: log: Convert log_test from python to C Sean Anderson
2020-11-03 15:11 ` Simon Glass
2020-10-17 18:07 ` Sean Anderson [this message]
2020-11-03 15:11 ` [PATCH v3 10/23] test: log: Give tests names instead of numbers Simon Glass
2020-10-17 18:07 ` [PATCH v3 11/23] test: Add tests for LOGFF_DENY Sean Anderson
2020-10-17 18:07 ` [PATCH v3 12/23] log: Add filter flag to match greater than a log level Sean Anderson
2020-10-17 18:07 ` [PATCH v3 13/23] test: Add test for LOGFF_MIN Sean Anderson
2020-10-17 18:07 ` [PATCH v3 14/23] cmd: log: Use sub-commands for log Sean Anderson
2020-10-17 18:07 ` [PATCH v3 15/23] cmd: log: Split off log level parsing Sean Anderson
2020-10-17 18:07 ` [PATCH v3 16/23] cmd: log: Add commands to list categories and drivers Sean Anderson
2020-10-17 18:07 ` [PATCH v3 17/23] cmd: log: Make "log level" print all log levels Sean Anderson
2020-10-17 18:07 ` [PATCH v3 18/23] lib: Add getopt Sean Anderson
2020-11-03 15:11 ` Simon Glass
2020-10-17 18:07 ` [PATCH v3 19/23] test: Add a test for getopt Sean Anderson
2020-11-03 15:11 ` Simon Glass
2020-10-17 18:07 ` [PATCH v3 20/23] cmd: log: Add commands to manipulate filters Sean Anderson
2020-10-17 18:07 ` [PATCH v3 21/23] test: Add a test for log filter-* Sean Anderson
2020-10-27 21:00 ` Tom Rini
2020-10-27 21:11 ` Sean Anderson
2020-10-27 21:12 ` Tom Rini
2020-10-17 18:07 ` [PATCH v3 22/23] doc: Add log kerneldocs to documentation Sean Anderson
2020-10-17 18:07 ` [PATCH v3 23/23] doc: Update logging documentation Sean Anderson
2020-10-27 20:58 ` Tom Rini
2020-10-27 21:00 ` Heinrich Schuchardt
2020-10-27 21:11 ` Sean Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201017180749.119271-11-seanga2@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox