Re: [PATCH v4 4/9] tests: Do not occlude subshell error codes when used as input to the test command

2021-10-14 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 07:39:58PM -0500, Glenn Washburn wrote: > When using the output of a subshell as input, its error code is ignored in > the context of "set -e". Many test scripts use grub-shell in a subshell with > output used as an argument to the test command to test

[PATCH v4 4/9] tests: Do not occlude subshell error codes when used as input to the test command

2021-10-12 Thread Glenn Washburn
When using the output of a subshell as input, its error code is ignored in the context of "set -e". Many test scripts use grub-shell in a subshell with output used as an argument to the test command to test for expected output. Refactor these tests so that the subshell output goes

Re: test command (in-)compatibility

2016-01-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 08.12.2015 17:36, Andrei Borzenkov wrote: > `test' in GRUB implicitly assumes `and' operation between consecutive > terms and does not enforce proper syntax like UNIX (bash) `test' does. Both > > test x y z > test x = y z = w > > result in error in Linux and are silently accepted by GRUB with

test command (in-)compatibility

2015-12-08 Thread Andrei Borzenkov
`test' in GRUB implicitly assumes `and' operation between consecutive terms and does not enforce proper syntax like UNIX (bash) `test' does. Both test x y z test x = y z = w result in error in Linux and are silently accepted by GRUB with interpretation test x -a y -a z test ( x = y ) -a ( z = w

Re: test command and signature checks

2015-01-29 Thread Jonathan McCune
On Thu, Jan 29, 2015 at 7:19 AM, Andrei Borzenkov wrote: > В Thu, 29 Jan 2015 06:17:42 -0800 > Jonathan McCune пишет: > > > On Jan 29, 2015 1:19 AM, "Andrei Borzenkov" wrote: > > > > > > What sematic of file tests should be? I think they should just test > > > file existence; this already happe

Re: test command and signature checks

2015-01-29 Thread Andrei Borzenkov
В Thu, 29 Jan 2015 06:17:42 -0800 Jonathan McCune пишет: > On Jan 29, 2015 1:19 AM, "Andrei Borzenkov" wrote: > > > > What sematic of file tests should be? I think they should just test > > file existence; this already happens for compressed files that checks > > that on-disk file size, not unco

Re: test command and signature checks

2015-01-29 Thread Jonathan McCune
On Jan 29, 2015 1:19 AM, "Andrei Borzenkov" wrote: > > What sematic of file tests should be? I think they should just test > file existence; this already happens for compressed files that checks > that on-disk file size, not uncompressed. I think same should apply to > signature checks. > Where t

test command and signature checks

2015-01-29 Thread Andrei Borzenkov
What sematic of file tests should be? I think they should just test file existence; this already happens for compressed files that checks that on-disk file size, not uncompressed. I think same should apply to signature checks. May be file checks should simply disable all filters unconditionally to

Re: [PATCH] Test command

2009-04-25 Thread Vladimir Serbinenko
commited On Thu, Apr 16, 2009 at 3:15 PM, phcoder wrote: > BTW, I think you can simplify test_parse. For example, you write "if (*argn >> + 2 < argc ...)" many times, but it should be possible to test this >> condition only once per loop. >> > Optimised. Perhaps compiler optimised this anyway bu

Re: [PATCH] Test command

2009-04-16 Thread phcoder
BTW, I think you can simplify test_parse. For example, you write "if (*argn + 2 < argc ...)" many times, but it should be possible to test this condition only once per loop. Optimised. Perhaps compiler optimised this anyway but it made code more readable Regards, Okuji __

Re: [PATCH] Test command

2009-04-14 Thread Yoshinori K. Okuji
On Sunday 12 April 2009 00:11:45 phcoder wrote: > Updated. Same changelog > > >> + { > >> + update_val (grub_strcmp (args[*argn], args[*argn + 2]) == 0); > >> + (*argn) += 3; > > > > I myself feel that these parentheses are redundant, but I don't know how > > others think. For

Re: [PATCH] Test command

2009-04-11 Thread phcoder
Updated. Same changelog + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) == 0); + (*argn) += 3; I myself feel that these parentheses are redundant, but I don't know how others think. For C programmers, it is well known that * has a very high priority. These

Re: [PATCH] Test command

2009-04-11 Thread Yoshinori K. Okuji
On Saturday 11 April 2009 07:18:59 phcoder wrote: > Rediffed. New changelog This time, I comment on all style problems. > diff --git a/commands/test.c b/commands/test.c > index a9c8281..2d8dedd 100644 > --- a/commands/test.c > +++ b/commands/test.c > @@ -21,33 +21,385 @@ > #include > #include

Re: [PATCH] Test command

2009-04-10 Thread phcoder
Rediffed. New changelog 2009-04-11 Vladimir Serbinenko Test command * commands/test.c: rewritten to use bash-like test phcoder wrote: Sorry forgot to attach the file phcoder wrote: Hello. Here is an implementation of bash-like "test" command. Many file tests a

[PATCH] Test command

2009-02-13 Thread phcoder
Sorry forgot to attach the file phcoder wrote: Hello. Here is an implementation of bash-like "test" command. Many file tests are omitted because they are useless in grub (e.g. -c test). I also added 3 extension: lexicographical comparing, prefixed -gt and -lt (it skips common pref

Test command

2009-02-13 Thread phcoder
Hello. Here is an implementation of bash-like "test" command. Many file tests are omitted because they are useless in grub (e.g. -c test). I also added 3 extension: lexicographical comparing, prefixed -gt and -lt (it skips common prefix. Useful for comparing versions. e.g. [ vmlin