]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: hush: Use UTF_CONSOLE in tests
authorSimon Glass <sjg@chromium.org>
Thu, 22 Aug 2024 13:58:00 +0000 (07:58 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 27 Aug 2024 00:51:49 +0000 (18:51 -0600)
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
test/hush/loop.c

index 4caa07c192aac2ff2c0340013855af63c7705489..91b097017c2a8fbf63b2f4bfac332d87d29bbe55 100644 (file)
@@ -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);
index d734abf136d51db04ceb00c1b4b2d4b239684db7..a9b6a8edf245564fde2191ec35c9329151c418f2 100644 (file)
@@ -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);