From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Simon Glass <sjg@chromium.org>,
U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Francis Laniel <francis.laniel@amarulasolutions.com>,
Ion Agorria <ion@agorria.com>,
Svyatoslav Ryhel <clamor95@gmail.com>
Subject: Re: [PATCH 17/21] test: hush: Use UTF_CONSOLE in tests
Date: Tue, 20 Aug 2024 09:08:09 +0200 [thread overview]
Message-ID: <8734mzwu1y.fsf@baylibre.com> (raw)
In-Reply-To: <20240810205205.3403177-18-sjg@chromium.org>
Hi Simon,
Thank you for the patch.
On sam., août 10, 2024 at 14:52, Simon Glass <sjg@chromium.org> wrote:
> Set this flag rather than doing things manually in the test.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>
> test/hush/dollar.c | 10 +++-------
> test/hush/loop.c | 11 +++--------
> 2 files changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/test/hush/dollar.c b/test/hush/dollar.c
> index 4caa07c192a..91b097017c2 100644
> --- a/test/hush/dollar.c
> +++ b/test/hush/dollar.c
> @@ -14,7 +14,6 @@ DECLARE_GLOBAL_DATA_PTR;
>
> static int hush_test_simple_dollar(struct unit_test_state *uts)
> {
> - console_record_reset_enable();
> ut_assertok(run_command("echo $dollar_foo", 0));
> ut_assert_nextline_empty();
> ut_assert_console_end();
> @@ -121,12 +120,11 @@ static int hush_test_simple_dollar(struct unit_test_state *uts)
>
> return 0;
> }
> -HUSH_TEST(hush_test_simple_dollar, 0);
> +HUSH_TEST(hush_test_simple_dollar, UTF_CONSOLE);
>
> static int hush_test_env_dollar(struct unit_test_state *uts)
> {
> env_set("env_foo", "bar");
> - console_record_reset_enable();
>
> ut_assertok(run_command("echo $env_foo", 0));
> ut_assert_nextline("bar");
> @@ -154,12 +152,10 @@ static int hush_test_env_dollar(struct unit_test_state *uts)
>
> return 0;
> }
> -HUSH_TEST(hush_test_env_dollar, 0);
> +HUSH_TEST(hush_test_env_dollar, UTF_CONSOLE);
>
> static int hush_test_command_dollar(struct unit_test_state *uts)
> {
> - console_record_reset_enable();
> -
> ut_assertok(run_command("dollar_bar=\"echo bar\"", 0));
>
> ut_assertok(run_command("$dollar_bar", 0));
> @@ -222,4 +218,4 @@ static int hush_test_command_dollar(struct unit_test_state *uts)
>
> return 0;
> }
> -HUSH_TEST(hush_test_command_dollar, 0);
> +HUSH_TEST(hush_test_command_dollar, UTF_CONSOLE);
> diff --git a/test/hush/loop.c b/test/hush/loop.c
> index d734abf136d..a9b6a8edf24 100644
> --- a/test/hush/loop.c
> +++ b/test/hush/loop.c
> @@ -14,8 +14,6 @@ DECLARE_GLOBAL_DATA_PTR;
>
> static int hush_test_for(struct unit_test_state *uts)
> {
> - console_record_reset_enable();
> -
> ut_assertok(run_command("for loop_i in foo bar quux quux; do echo $loop_i; done", 0));
> ut_assert_nextline("foo");
> ut_assert_nextline("bar");
> @@ -32,12 +30,10 @@ static int hush_test_for(struct unit_test_state *uts)
>
> return 0;
> }
> -HUSH_TEST(hush_test_for, 0);
> +HUSH_TEST(hush_test_for, UTF_CONSOLE);
>
> static int hush_test_while(struct unit_test_state *uts)
> {
> - console_record_reset_enable();
> -
> if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
> /*
> * Hush 2021 always returns 0 from while loop...
> @@ -65,11 +61,10 @@ static int hush_test_while(struct unit_test_state *uts)
>
> return 0;
> }
> -HUSH_TEST(hush_test_while, 0);
> +HUSH_TEST(hush_test_while, UTF_CONSOLE);
>
> static int hush_test_until(struct unit_test_state *uts)
> {
> - console_record_reset_enable();
> env_set("loop_bar", "bar");
>
> /*
> @@ -87,4 +82,4 @@ static int hush_test_until(struct unit_test_state *uts)
> env_set("loop_bar", NULL);
> return 0;
> }
> -HUSH_TEST(hush_test_until, 0);
> +HUSH_TEST(hush_test_until, UTF_CONSOLE);
> --
> 2.34.1
next prev parent reply other threads:[~2024-08-20 7:08 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-10 20:51 [PATCH 00/21] Tidy up console recording in tests Simon Glass
2024-08-10 20:51 ` [PATCH 01/21] buildman: Make test_process_limit handle time.monotonic() Simon Glass
2024-08-10 20:51 ` [PATCH 02/21] test: Fail when an empty line is expected but not present Simon Glass
2024-08-20 6:40 ` Mattijs Korpershoek
2024-08-10 20:51 ` [PATCH 03/21] test: Rename unit-test flags Simon Glass
2024-08-10 20:51 ` [PATCH 04/21] test: Drop the blank line before test macros Simon Glass
2024-08-10 20:51 ` [PATCH 05/21] test: Rename UTF_CONSOLE_REC to UTF_CONSOLE Simon Glass
2024-08-20 6:48 ` Mattijs Korpershoek
2024-08-10 20:51 ` [PATCH 06/21] mmc: Drop the blank line before accesses Simon Glass
2024-08-15 17:01 ` Tom Rini
2024-08-15 20:34 ` Simon Glass
2024-08-16 3:47 ` Tom Rini
2024-08-10 20:51 ` [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet" Simon Glass
2024-08-11 2:47 ` Yasuharu Shibata
2024-08-11 14:50 ` Simon Glass
2024-08-12 18:46 ` Tom Rini
2024-08-13 3:48 ` Yasuharu Shibata
2024-08-13 12:20 ` Simon Glass
2024-08-13 15:12 ` Simon Glass
2024-08-14 13:05 ` Yasuharu Shibata
2024-08-13 12:16 ` Simon Glass
2024-08-10 20:51 ` [PATCH 08/21] sandbox: Enable wget command Simon Glass
2024-08-10 20:51 ` [PATCH 09/21] test: Update NAND test to avoid extra macros Simon Glass
2024-08-17 18:29 ` Sean Anderson
2024-08-10 20:51 ` [PATCH 10/21] test: bloblist: Use UTF_CONSOLE in tests Simon Glass
2024-08-10 20:51 ` [PATCH 11/21] test: boot: " Simon Glass
2024-08-20 7:02 ` Mattijs Korpershoek
2024-08-10 20:51 ` [PATCH 12/21] test: fdt: Check internal-function return values Simon Glass
2024-08-10 20:51 ` [PATCH 13/21] test: fdt: Move common code into the setup functions Simon Glass
2024-08-10 20:51 ` [PATCH 14/21] test: cmd: Use UTF_CONSOLE in tests Simon Glass
2024-08-10 20:51 ` [PATCH 15/21] test: cmd: Drop unnecessary console_record_reset_enable() Simon Glass
2024-08-10 20:52 ` [PATCH 16/21] test: dm: Use UTF_CONSOLE in tests Simon Glass
2024-08-10 20:52 ` [PATCH 17/21] test: hush: " Simon Glass
2024-08-20 7:08 ` Mattijs Korpershoek [this message]
2024-08-10 20:52 ` [PATCH 18/21] test: log: " Simon Glass
2024-08-10 20:52 ` [PATCH 19/21] test: Use UTF_CONSOLE in remaining tests Simon Glass
2024-08-10 20:52 ` [PATCH 20/21] test: Tidy up checking for console end Simon Glass
2024-08-10 20:52 ` [PATCH 21/21] doc: Add a few notes about how to use console checking Simon Glass
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=8734mzwu1y.fsf@baylibre.com \
--to=mkorpershoek@baylibre.com \
--cc=clamor95@gmail.com \
--cc=francis.laniel@amarulasolutions.com \
--cc=ion@agorria.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.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