[RFC PATCH v5 06/24] test: hush: Test hush loops

2022-11-01 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 65 ++ 2 files changed, 66 insertions(+) create mode 100644 test/hush

[RFC PATCH v5 04/24] test: hush: Test hush variable expansion

2022-11-01 Thread Francis Laniel
Verifies shell variables are replaced by their values. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 167 +++ test/py/tests/test_ut.py | 8 +- 3 files changed, 175 insertions(+), 1 deletion(-) create mode

[RFC PATCH v5 05/24] test: hush: Test hush commands list

2022-11-01 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[RFC PATCH v5 03/24] test/py: hush_if_test: Remove the test file

2022-11-01 Thread Francis Laniel
ce40f44eb336 ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 184 - 1 file changed, 184 deletions(

[RFC PATCH v5 02/24] test: hush: Test hush if/else

2022-11-01 Thread Francis Laniel
As asked in commit 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[RFC PATCH v5 01/24] test: Add framework to test hush behavior

2022-11-01 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[RFC PATCH v5 00/24] Modernize U-Boot shell

2022-11-01 Thread Francis Laniel
Various cleaning. * Modified python test to accept failure output when the test are designed to fail. * Bumped upstream busybox hush commits until 24h March 2022. Francis Laniel (24): test: Add framework to test hush behavior test: hush: Test hush if/else test/py: hush_if_test: Remove t

[PATCH] for debug purpose only: add print to debug odd behavior.

2022-10-10 Thread Francis Laniel
Hi. I am really sorry for the delay in answer. Sadly, I am not able to send a v5 for the moment. Indeed, I am still struggling with the same bug since a lot of time... It happens in the Azure pipeline but also locally with test.py. I am sure the bug is related to memory management as the

Re: [RFC PATCH v4 26/28] for test purpose only: Comment out dollar tests which prints error messages.

2022-08-12 Thread Francis Laniel
Le vendredi 17 juin 2022, 16:02:35 CEST Tom Rini a écrit : > On Fri, Jun 17, 2022 at 12:31:56AM +0200, Francis Laniel wrote: > > Error messages like "unknown command" will make the CI fails. > > So, for the moment, we comment these tests. > > > > Signed-off-

Re: [RFC PATCH v4 28/28] board: keymile: common: Use environment to store IVM_* variables.

2022-08-12 Thread Francis Laniel
Hi. Le lundi 20 juin 2022, 19:33:24 CEST Tom Rini a écrit : > On Mon, Jun 20, 2022 at 04:08:32PM +, Holger Brunck wrote: > > > > > On Fri, Jun 17, 2022 at 12:31:58AM +0200, Francis Laniel wrote: > > > > > > These boards used set_local_var() to store some

Re: [RFC PATCH v4 25/28] cli: hush_2021: Add upstream commits up to 6th February 2022.

2022-08-12 Thread Francis Laniel
Hi. Le lundi 20 juin 2022, 21:11:00 CEST Tom Rini a écrit : > On Fri, Jun 17, 2022 at 12:31:55AM +0200, Francis Laniel wrote: > > This commit adds the following hush busybox upstream commits: > > 21afddefd258 ("hush: fix "error: invalid preprocessing directive ##"&

[RFC PATCH v4 15/28] cli: hush_2021: Add functions to be called from run_command()

2022-06-16 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to hush 2021. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[RFC PATCH v4 27/28] for test purpose only: Comment out failed function which fails only in CI.

2022-06-16 Thread Francis Laniel
Signed-off-by: Francis Laniel --- test/cmd/setexpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c index 0dc94f7e61..71c751d766 100644 --- a/test/cmd/setexpr.c +++ b/test/cmd/setexpr.c @@ -308,7 +308,7 @@ static int setexpr_test_str

[RFC PATCH v4 18/28] test: hush: Fix variable expansion tests for hush 2021

2022-06-16 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel --- test/hush/dollar.c | 79

[RFC PATCH v4 21/28] test: hush: Fix if tests for hush 2021

2022-06-16 Thread Francis Laniel
Modifies the command run for hush 2021 when using string comparison operator. Indeed, '<' and '>' must be escaped to be used as these operators. Signed-off-by: Francis Laniel --- test/hush/if.c | 45 + 1 file changed, 45 insertions(+) diff

[RFC PATCH v4 10/28] cli: Add menu for hush parser

2022-06-16 Thread Francis Laniel
For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the default. The goal is to prepare the field to add a new hush parser which guarantees actual behavior is still correct. Signed-off-by: Francis Laniel --- cmd/Kconfig | 21 + common/Makefile | 3

[RFC PATCH v4 26/28] for test purpose only: Comment out dollar tests which prints error messages.

2022-06-16 Thread Francis Laniel
Error messages like "unknown command" will make the CI fails. So, for the moment, we comment these tests. Signed-off-by: Francis Laniel --- test/hush/dollar.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/hush/dollar.c b/test/hus

[RFC PATCH v4 20/28] cli: hush_2021: Enable if keyword

2022-06-16 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/cli_hush_up

[RFC PATCH v4 28/28] board: keymile: common: Use environment to store IVM_* variables.

2022-06-16 Thread Francis Laniel
to environment ones. Signed-off-by: Francis Laniel --- board/keymile/common/common.c | 8 board/keymile/common/ivm.c| 9 + 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 3999f48719..72939af36e 100644

[RFC PATCH v4 14/28] cli: hush_2021: Enable variables expansion for hush 2021

2022-06-16 Thread Francis Laniel
Enables variables expansion for hush 2021, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- co

[RFC PATCH v4 25/28] cli: hush_2021: Add upstream commits up to 6th February 2022.

2022-06-16 Thread Francis Laniel
IGINT while waiting for interactive input") 987be932ed3c ("*: slap on a few ALIGN_PTR where appropriate") Signed-off-by: Francis Laniel --- common/cli_hush_upstream.c | 157 +++-- 1 file changed, 117 insertions(+), 40 deletions(-) diff --git a/comm

[RFC PATCH v4 24/28] Modernize U-Boot shell

2022-06-16 Thread Francis Laniel
From: Tom Rini On Fri, Apr 01, 2022 at 01:26:53AM +0200, Francis Laniel wrote: > Hi. > > First I hope you are fine and the same for your relatives. > I would also like to apologize for the delay between v2 and v3. > > During 2021 summer, Sean Anderson wrote a contribution

[RFC PATCH v4 13/28] cli: Enables using hush 2021 parser as command line parser

2022-06-16 Thread Francis Laniel
If one defines HUSH_2021_PARSER, it is then possible to use 2021 parser with: => parser get old => parser set 2021 2021> parser get 2021 Signed-off-by: Francis Laniel --- cmd/parser.c | 14 - common/cli.c | 38

[RFC PATCH v4 23/28] test: hush: Fix loop tests for hush 2021

2022-06-16 Thread Francis Laniel
Modifies return code got from while loop as hush 2021 always returns 0 from while loop. Signed-off-by: Francis Laniel --- test/hush/loop.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/hush/loop.c b/test/hush/loop.c index 519c78ef7e

[RFC PATCH v4 22/28] cli: hush_2021: Enable loops

2022-06-16 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b

[RFC PATCH v4 11/28] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag.

2022-06-16 Thread Francis Laniel
This flag is used to indicate we are using the hush parser. Signed-off-by: Francis Laniel --- common/cli.c | 2 ++ include/asm-generic/global_data.h | 4 2 files changed, 6 insertions(+) diff --git a/common/cli.c b/common/cli.c index a7e3d84b68..ef967f4f9e 100644

[RFC PATCH v4 12/28] cmd: Add new parser command.

2022-06-16 Thread Francis Laniel
This command can be used to print the current parser with 'parser print'. It can also be used to set the current parser with 'parser set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel --- cmd/Makefile | 2 + cmd/parser.c | 113

[RFC PATCH v4 17/28] test: hush: Fix instructions list tests for hush 2021

2022-06-16 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel --- test/hush/list.c | 69

[RFC PATCH v4 19/28] cli: hush_2021: Enable using \< and \> as string compare operators

2022-06-16 Thread Francis Laniel
loper to think about its code, as in a lot of case, we want to compare integers (using '-lt' or '-gt') rather than strings. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion

[RFC PATCH v4 16/28] cli: add hush 2021 as parser for run_command*().

2022-06-16 Thread Francis Laniel
Enables using, in code, hush 2021 as parser for run_command function family. It also enables the command run to be used by CLI user of hush 2021. Signed-off-by: Francis Laniel --- common/cli.c | 60 -- common/cli_hush_upstream.c | 2 +- 2 files

[RFC PATCH v4 09/28] cli: Port Busybox 2021 hush to U-Boot

2022-06-16 Thread Francis Laniel
-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_2021.c | 286 + common/cli_hush_upstream.c | 494 - 2 files changed, 779 insertions(+), 1 deletion(-) create mode 100644 common/cli_hush_2021.c diff --git a/common

[RFC PATCH v4 07/28] test: hush: Test hush loops

2022-06-16 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 64 ++ 2 files changed, 65 insertions(+) create mode 100644 test/hush

[RFC PATCH v4 06/28] test: hush: Test hush commands list

2022-06-16 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[RFC PATCH v4 05/28] test: hush: Test hush variable expansion

2022-06-16 Thread Francis Laniel
Verifies shell variables are replaced by their values. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 167 + 2 files changed, 168 insertions(+) create mode 100644 test/hush/dollar.c diff --git a/test/hush/Makefile

[RFC PATCH v4 04/28] test/py: hush_if_test: Remove the test file

2022-06-16 Thread Francis Laniel
ce40f44eb336 ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 184 - 1 file changed, 184 deletions(

[RFC PATCH v4 02/28] test: Add framework to test hush behavior

2022-06-16 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[RFC PATCH v4 03/28] test: hush: Test hush if/else

2022-06-16 Thread Francis Laniel
As asked in 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[RFC PATCH v4 01/28] video: sandbox: Add dummy function for sandbox_sdl_remove_display().

2022-06-16 Thread Francis Laniel
We need to defined a dummy version of this function when compiling with NO_SDL=1. Otherwise, we would face compilation error. Fixes: 250e735c692b ("video: sandbox: Avoid duplicate display windows") Signed-off-by: Francis Laniel --- arch/sandbox/include/asm/sdl.h | 5 + 1 file

[RFC PATCH v4 00/28] Modernize U-Boot shell

2022-06-16 Thread Francis Laniel
fact it calls cli_init() and cli_loop() each time the parser is set, so your reviews would be welcomed. * Other commits focus on enabling features we need (e.g. if). Changes since v2: * Added a small fix to compile sandbox with NO_SDL=1. * Added a command to change parser at runtime. * Added 2021 parser f

[RFC PATCH v3 02/23] test: Add framework to test hush behavior

2022-03-31 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[RFC PATCH v3 15/23] cli: hush_2021: Add functions to be called from run_command()

2022-03-31 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to hush 2021. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[RFC PATCH v3 03/23] test: hush: Test hush if/else

2022-03-31 Thread Francis Laniel
As asked in 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[RFC PATCH v3 07/23] test: hush: Test hush loops

2022-03-31 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 64 ++ 2 files changed, 65 insertions(+) create mode 100644 test/hush

[RFC PATCH v3 01/23] video: sandbox: Add dummy function for sandbox_sdl_remove_display().

2022-03-31 Thread Francis Laniel
We need to defined a dummy version of this function when compiling with NO_SDL=1. Otherwise, we would face compilation error. Fixes: 250e735c692b ("video: sandbox: Avoid duplicate display windows") Signed-off-by: Francis Laniel --- arch/sandbox/include/asm/sdl.h | 5 + 1 file

[RFC PATCH v3 14/23] cli: hush_2021: Enable variables expansion for hush 2021

2022-03-31 Thread Francis Laniel
Enables variables expansion for hush 2021, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- co

[RFC PATCH v3 09/23] cli: Port Busybox 2021 hush to U-Boot

2022-03-31 Thread Francis Laniel
-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_2021.c | 292 +++ common/cli_hush_upstream.c | 474 - 2 files changed, 765 insertions(+), 1 deletion(-) create mode 100644 common/cli_hush_2021.c diff --git a/common

[RFC PATCH v3 06/23] test: hush: Test hush commands list

2022-03-31 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[RFC PATCH v3 13/23] cli: Enables using hush 2021 parser as command line parser

2022-03-31 Thread Francis Laniel
If one defines HUSH_2021_PARSER, it is then possible to use 2021 parser with: => parser print old => parser set 2021 2021> parser get 2021 Signed-off-by: Francis Laniel --- cmd/parser.c | 14 - common/cli.c | 38

[RFC PATCH v3 22/23] cli: hush_2021: Enable loops

2022-03-31 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b

[RFC PATCH v3 20/23] cli: hush_2021: Enable if keyword

2022-03-31 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/cli_hush_up

[RFC PATCH v3 23/23] test: hush: Fix loop tests for hush 2021

2022-03-31 Thread Francis Laniel
Modifies return code got from while loop as hush 2021 always returns 0 from while loop. Signed-off-by: Francis Laniel --- test/hush/loop.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/hush/loop.c b/test/hush/loop.c index 519c78ef7e

[RFC PATCH v3 12/23] cmd: Add new parser command.

2022-03-31 Thread Francis Laniel
This command can be used to print the current parser with 'parser print'. It can also be used to set the current parser with 'parser set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel --- cmd/Makefile | 2 + cmd/parser.c | 113

[RFC PATCH v3 11/23] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag.

2022-03-31 Thread Francis Laniel
This flag is used to indicate we are using the hush parser. Signed-off-by: Francis Laniel --- common/cli.c | 2 ++ include/asm-generic/global_data.h | 4 2 files changed, 6 insertions(+) diff --git a/common/cli.c b/common/cli.c index a7e3d84b68..ef967f4f9e 100644

[RFC PATCH v3 17/23] test: hush: Fix instructions list tests for hush 2021

2022-03-31 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel --- test/hush/list.c | 69

[RFC PATCH v3 10/23] cli: Add menu for hush parser

2022-03-31 Thread Francis Laniel
For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the default. The goal is to prepare the field to add a new hush parser which guarantees actual behavior is still correct. Signed-off-by: Francis Laniel --- cmd/Kconfig | 21 + common/Makefile | 3

[RFC PATCH v3 00/23] Modernize U-Boot shell

2022-03-31 Thread Francis Laniel
ce v2: * Added a small fix to compile sandbox with NO_SDL=1. * Added a command to change parser at runtime. * Added 2021 parser function to all run_command*(). * Adapted Francis Laniel (23): video: sandbox: Add dummy function for sandbox_sdl_remove_display(). test: Add framework to test hush

[RFC PATCH v3 19/23] cli: hush_2021: Enable using \< and \> as string compare operators

2022-03-31 Thread Francis Laniel
loper to think about its code, as in a lot of case, we want to compare integers (using '-lt' or '-gt') rather than strings. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion

[RFC PATCH v3 21/23] test: hush: Fix if tests for hush 2021

2022-03-31 Thread Francis Laniel
Modifies the command run for hush 2021 when using string comparison operator. Indeed, '<' and '>' must be escaped to be used as these operators. Signed-off-by: Francis Laniel --- test/hush/if.c | 45 + 1 file changed, 45 insertions(+) diff

[RFC PATCH v3 18/23] test: hush: Fix variable expansion tests for hush 2021

2022-03-31 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel --- test/hush/dollar.c | 79

[RFC PATCH v3 16/23] cli: add hush 2021 as parser for run_command*().

2022-03-31 Thread Francis Laniel
Enables using, in code, hush 2021 as parser for run_command function family. It also enables the command run to be used by CLI user of hush 2021. Signed-off-by: Francis Laniel --- common/cli.c | 60 -- common/cli_hush_upstream.c | 2 +- 2 files

[RFC PATCH v3 05/23] test: hush: Test hush variable expansion

2022-03-31 Thread Francis Laniel
Verifies shell variables are replaced by their values. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 175 + 2 files changed, 176 insertions(+) create mode 100644 test/hush/dollar.c diff --git a/test/hush/Makefile

[RFC PATCH v3 04/23] test/py: hush_if_test: Remove the test file

2022-03-31 Thread Francis Laniel
ce40f44eb336 ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 184 - 1 file changed, 184 deletions(

Re: [RFC PATCH v1 16/21] test: hush: Fix variable expansion tests for hush 2021.

2022-03-23 Thread Francis Laniel
Hi. (Sorry for the very late reply) Le lundi 7 février 2022, 21:22:20 CET Simon Glass a écrit : > Hi Francis, > > On Sun, 6 Feb 2022 at 11:23, Francis Laniel > > wrote: > > Le mercredi 12 janvier 2022, 21:03:37 CET Simon Glass a écrit : > > > Hi Francis, &g

[RFC PATCH v2 21/21] test: hush: Fix loop tests for hush 2021

2022-02-06 Thread Francis Laniel
Modifies return code got from while loop as hush 2021 always returns 0 from while loop. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/loop.c | 20 1 file changed, 20 insertions(+) diff --git a/test/hush/loop.c b/test/hush/loop.c index 519c78ef7e

[RFC PATCH v2 20/21] cli: hush_2021: Enable loops

2022-02-06 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b

[RFC PATCH v2 19/21] test: hush: Fix if tests for hush 2021

2022-02-06 Thread Francis Laniel
Modifies the command run for hush 2021 when using string comparison operator. Indeed, '<' and '>' must be escaped to be used as these operators. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/if.c | 43 +++ 1 file chang

[RFC PATCH v2 18/21] cli: hush_2021: Enable if keyword

2022-02-06 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/cli_hush_up

[RFC PATCH v2 17/21] cli: hush_2021: Enable using \< and \> as string compare operators

2022-02-06 Thread Francis Laniel
loper to think about its code, as in a lot of case, we want to compare integers (using '-lt' or '-gt') rather than strings. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion

[RFC PATCH v2 16/21] test: hush: Fix variable expansion tests for hush 2021

2022-02-06 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/dollar.c | 51

[RFC PATCH v2 15/21] test: hush: Fix instructions list tests for hush 2021

2022-02-06 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/list.c | 48

[RFC PATCH v2 14/21] cli: Modify run_command() to add hush 2021 as parser

2022-02-06 Thread Francis Laniel
Enables using, in code, run_command() while using hush 2021 as parser. It also enables the command run to be used by CLI user of hush 2021. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff

[RFC PATCH v2 13/21] cli: hush_2021: Add functions to be called from run_command()

2022-02-06 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to hush 2021. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[RFC PATCH v2 12/21] cli: hush_2021: Enable variables expansion for hush 2021

2022-02-06 Thread Francis Laniel
Enables variables expansion for hush 2021, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- co

[RFC PATCH v2 11/21] cli: Enables using hush 2021 parser as command line parser

2022-02-06 Thread Francis Laniel
If one defines HUSH_2021_PARSER, cli_loop() will jump on hush 2021 parser code. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli.c | 14 +++--- include/cli_hush.h | 8 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/cli.c b

[RFC PATCH v2 10/21] cli: Add HUSH_2021_PARSER to hush parser choice

2022-02-06 Thread Francis Laniel
To use hush 2021 as U-Boot shell, one should tick "Use hush 2021 parser" under "Hush flavor to use" choice. Since this is a choice, you cannot use at the same time old and new flavor of hush. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- cmd/Kconfig

[RFC PATCH v2 08/21] cli: Port Busybox 2021 hush to U-Boot

2022-02-06 Thread Francis Laniel
-by: Francis Laniel Signed-off-by: Harald Seiler Reviewed-by: Simon Glass --- common/cli_hush_2021.c | 292 +++ common/cli_hush_upstream.c | 470 - 2 files changed, 761 insertions(+), 1 deletion(-) create mode 100644 common/cli_hush_2021

[RFC PATCH v2 09/21] cli: Add choice for hush parser

2022-02-06 Thread Francis Laniel
For the moment, the choice contains only entry: HUSH_OLD_PARSER which is the default. The goal is to prepare the field to add a new hush parser which guarantees actual behavior is still correct. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- cmd/Kconfig | 14

[RFC PATCH v2 06/21] test: hush: Test hush loops

2022-02-06 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 64 ++ 2 files changed, 65 insertions(+) create mode 100644 test/hush

[RFC PATCH v2 04/21] test: hush: Test hush variable expansion

2022-02-06 Thread Francis Laniel
Verifies shell variables are replaced by their values. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 175 + 2 files changed, 176 insertions(+) create mode 100644 test/hush/dollar.c diff --git a/test/hush/Makefile

[RFC PATCH v2 05/21] test: hush: Test hush commands list

2022-02-06 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[RFC PATCH v2 02/21] test: hush: Test hush if/else

2022-02-06 Thread Francis Laniel
As asked in 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[RFC PATCH v2 03/21] test/py: hush_if_test: Remove the test file

2022-02-06 Thread Francis Laniel
ce40f44eb336 ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 184 - 1 file changed, 184 deletions(

[RFC PATCH v2 01/21] test: Add framework to test hush behavior

2022-02-06 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[RFC PATCH v2 00/21] Modernize U-Boot shell

2022-02-06 Thread Francis Laniel
cli_hush_upstream.c. * Addressed reviews regarding variable expansion unit test. Francis Laniel (21): test: Add framework to test hush behavior test: hush: Test hush if/else test/py: hush_if_test: Remove the test file test: hush: Test hush variable expansion test: hush: Test hush comma

Re: [RFC PATCH v1 17/21] cli: hush_2021: Enable using \< and \> as string compare operators.

2022-02-06 Thread Francis Laniel
Le mercredi 12 janvier 2022, 21:03:40 CET Simon Glass a écrit : > Hi Francis, > > On Fri, 31 Dec 2021 at 09:14, Francis Laniel > > wrote: > > In Busybox hush, '<' and '>' are used as redirection operators. > > For example, cat foo > bar will write content o

Re: [RFC PATCH v1 16/21] test: hush: Fix variable expansion tests for hush 2021.

2022-02-06 Thread Francis Laniel
Le mercredi 12 janvier 2022, 21:03:37 CET Simon Glass a écrit : > Hi Francis, > > On Fri, 31 Dec 2021 at 09:14, Francis Laniel > > wrote: > > This commit modifies the expected result for hush 2021. > > Indeed, there were bugs in actual U-Boot hush which were fi

Re: [RFC PATCH v1 04/21] test: hush: Test hush variable expansion.

2022-02-06 Thread Francis Laniel
Hi. First, sorry for the delayed answer and thank you a lot for all your reviews! Le samedi 8 janvier 2022, 15:53:49 CET Simon Glass a écrit : > Hi Francis, > > On Fri, 31 Dec 2021 at 09:14, Francis Laniel > > wrote: > > This commit ensures shell variables are rep

[RFC PATCH v1 15/21] test: hush: Fix instructions list tests for hush 2021.

2021-12-31 Thread Francis Laniel
This commit modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel --- test/hush/list.c | 48

[RFC PATCH v1 06/21] test: hush: Test hush loops.

2021-12-31 Thread Francis Laniel
The added tests ensure correct behavior of for, while and until loops. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/loop.c | 64 ++ 2 files changed, 65 insertions(+) create mode 100644 test/hush/loop.c diff --git a/test

[RFC PATCH v1 03/21] test/py: hush_if_test: Remove the test file.

2021-12-31 Thread Francis Laniel
Commit 9087ab2cc4 ("test/py: hush_if_test: Remove the test file.") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel --- test/py/tests/test_hush_if_test.py | 184 - 1 file changed, 184 deletions(-) d

[RFC PATCH v1 21/21] test: hush: Fix loop tests for hush 2021.

2021-12-31 Thread Francis Laniel
This commit modifies return code got from while loop as hush 2021 always returns 0 from while loop. Signed-off-by: Francis Laniel --- test/hush/loop.c | 20 1 file changed, 20 insertions(+) diff --git a/test/hush/loop.c b/test/hush/loop.c index 519c78ef7e..56aae719dc

[RFC PATCH v1 20/21] cli: hush_2021: Enable loops.

2021-12-31 Thread Francis Laniel
This commit enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel --- common/cli_hush_2021_upstream.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_2021_upstream.c b

[RFC PATCH v1 18/21] cli: hush_2021: Enable if keyword.

2021-12-31 Thread Francis Laniel
This commit adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel --- common/cli_hush_2021_upstream.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/cli_hush_2021_up

[RFC PATCH v1 19/21] test: hush: Fix if tests for hush 2021.

2021-12-31 Thread Francis Laniel
This commit modifies the command run for hush 2021 when using string comparison operator. Indeed, '<' and '>' must be escaped to be used as string comparison operator. Signed-off-by: Francis Laniel --- test/hush/if.c | 43 +++ 1 file chang

[RFC PATCH v1 11/21] cli: Enables using hush 2021 parser as command line parser.

2021-12-31 Thread Francis Laniel
If one defines HUSH_2021_PARSER, cli_loop() will jump on hush 2021 parser code. Signed-off-by: Francis Laniel --- common/cli.c | 14 +++--- include/cli_hush.h | 8 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/cli.c b/common/cli.c index

[RFC PATCH v1 17/21] cli: hush_2021: Enable using \< and \> as string compare operators.

2021-12-31 Thread Francis Laniel
loper to think about its code, as in a lot of case, we want to compare integers (using '-lt' or '-gt') rather than strings. Signed-off-by: Francis Laniel --- common/cli_hush_2021_upstream.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/common/cl

[RFC PATCH v1 16/21] test: hush: Fix variable expansion tests for hush 2021.

2021-12-31 Thread Francis Laniel
This commit modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Signed-off-by: Francis Laniel --- test/hush/dollar.c | 51

[RFC PATCH v1 14/21] cli: Modify run_command() to add hush 2021 as parser.

2021-12-31 Thread Francis Laniel
This commit then enables using, in code, run_command() while using hush 2021 as parser. It also enables the command run to be used by CLI user of hush 2021. Signed-off-by: Francis Laniel --- common/cli.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git

[RFC PATCH v1 13/21] cli: hush_2021: Add functions to be called from run_command().

2021-12-31 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to hush 2021. Signed-off-by: Francis Laniel --- common/cli_hush_2021_upstream.c | 66 +++-- 1 file

[RFC PATCH v1 12/21] cli: hush_2021: Enable variables expansion for hush 2021.

2021-12-31 Thread Francis Laniel
The following commit enables variables expansion for hush 2021, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel --- co

<    1   2   3   4   >