Re: [U-Boot] [PATCH v6 1/6] env: add the same prefix to error messages to make it detectable by tests

2018-07-09 Thread Quentin Schulz
Hi all,

This series was tested with Travis:

https://travis-ci.org/QSchulz/u-boot/builds/401644733

I can't explain why 45, 46 and 49 are failing but they have the
following error message:
The command "sudo apt-get install libisl15 -y" failed and exited with
100 during .

It's unrelated to this patch series (happened multiple times without my
patch series) as far as I can tell.

Quentin

On Mon, Jul 09, 2018 at 07:16:25PM +0200, Quentin Schulz wrote:
> The error message should start with `## Error: ` so that it's easily
> detectable by tests without needing to have a complex regexp for
> matching all possible error message patterns.
> 
> Let's add the `## Error: ` prefix to the error messages since it's the
> one already in use.
> 
> Suggested-by: Stephen Warren 
> Signed-off-by: Quentin Schulz 
> Reviewed-by: Simon Glass 
> Reviewed-by: Stephen Warren 
> Tested-by: Stephen Warren 
> ---
> 
> added in v5
> 
>  cmd/nvedit.c | 12 
>  env/common.c |  3 ++-
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> index ddc888a..70d7068 100644
> --- a/cmd/nvedit.c
> +++ b/cmd/nvedit.c
> @@ -959,7 +959,8 @@ NXTARG:   ;
>   H_MATCH_KEY | H_MATCH_IDENT,
>   , size, argc, argv);
>   if (len < 0) {
> - pr_err("Cannot export environment: errno = %d\n", 
> errno);
> + pr_err("## Error: Cannot export environment: errno = 
> %d\n",
> +errno);
>   return 1;
>   }
>   sprintf(buf, "%zX", (size_t)len);
> @@ -979,7 +980,8 @@ NXTARG:   ;
>   H_MATCH_KEY | H_MATCH_IDENT,
>   , ENV_SIZE, argc, argv);
>   if (len < 0) {
> - pr_err("Cannot export environment: errno = %d\n", errno);
> + pr_err("## Error: Cannot export environment: errno = %d\n",
> +errno);
>   return 1;
>   }
>  
> @@ -994,7 +996,8 @@ NXTARG:   ;
>   return 0;
>  
>  sep_err:
> - printf("## %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n", cmd);
> + printf("## Error: %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n",
> +cmd);
>   return 1;
>  }
>  #endif
> @@ -1114,7 +1117,8 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
>  
>   if (himport_r(_htab, ptr, size, sep, del ? 0 : H_NOCLEAR,
>   crlf_is_lf, 0, NULL) == 0) {
> - pr_err("Environment import failed: errno = %d\n", errno);
> + pr_err("## Error: Environment import failed: errno = %d\n",
> +errno);
>   return 1;
>   }
>   gd->flags |= GD_FLG_ENV_READY;
> diff --git a/env/common.c b/env/common.c
> index dc8a14f..7bd2790 100644
> --- a/env/common.c
> +++ b/env/common.c
> @@ -83,7 +83,8 @@ void set_default_env(const char *s)
>   if (himport_r(_htab, (char *)default_environment,
>   sizeof(default_environment), '\0', flags, 0,
>   0, NULL) == 0)
> - pr_err("Environment import failed: errno = %d\n", errno);
> + pr_err("## Error: Environment import failed: errno = %d\n",
> +errno);
>  
>   gd->flags |= GD_FLG_ENV_READY;
>   gd->flags |= GD_FLG_ENV_DEFAULT;
> 
> base-commit: 22d58e60ffb5484d912f26b9c3533eff1d3d3de9
> -- 
> git-series 0.9.1


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v6 1/6] env: add the same prefix to error messages to make it detectable by tests

2018-07-09 Thread Quentin Schulz
The error message should start with `## Error: ` so that it's easily
detectable by tests without needing to have a complex regexp for
matching all possible error message patterns.

Let's add the `## Error: ` prefix to the error messages since it's the
one already in use.

Suggested-by: Stephen Warren 
Signed-off-by: Quentin Schulz 
Reviewed-by: Simon Glass 
Reviewed-by: Stephen Warren 
Tested-by: Stephen Warren 
---

added in v5

 cmd/nvedit.c | 12 
 env/common.c |  3 ++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index ddc888a..70d7068 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -959,7 +959,8 @@ NXTARG: ;
H_MATCH_KEY | H_MATCH_IDENT,
, size, argc, argv);
if (len < 0) {
-   pr_err("Cannot export environment: errno = %d\n", 
errno);
+   pr_err("## Error: Cannot export environment: errno = 
%d\n",
+  errno);
return 1;
}
sprintf(buf, "%zX", (size_t)len);
@@ -979,7 +980,8 @@ NXTARG: ;
H_MATCH_KEY | H_MATCH_IDENT,
, ENV_SIZE, argc, argv);
if (len < 0) {
-   pr_err("Cannot export environment: errno = %d\n", errno);
+   pr_err("## Error: Cannot export environment: errno = %d\n",
+  errno);
return 1;
}
 
@@ -994,7 +996,8 @@ NXTARG: ;
return 0;
 
 sep_err:
-   printf("## %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n", cmd);
+   printf("## Error: %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n",
+  cmd);
return 1;
 }
 #endif
@@ -1114,7 +1117,8 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
 
if (himport_r(_htab, ptr, size, sep, del ? 0 : H_NOCLEAR,
crlf_is_lf, 0, NULL) == 0) {
-   pr_err("Environment import failed: errno = %d\n", errno);
+   pr_err("## Error: Environment import failed: errno = %d\n",
+  errno);
return 1;
}
gd->flags |= GD_FLG_ENV_READY;
diff --git a/env/common.c b/env/common.c
index dc8a14f..7bd2790 100644
--- a/env/common.c
+++ b/env/common.c
@@ -83,7 +83,8 @@ void set_default_env(const char *s)
if (himport_r(_htab, (char *)default_environment,
sizeof(default_environment), '\0', flags, 0,
0, NULL) == 0)
-   pr_err("Environment import failed: errno = %d\n", errno);
+   pr_err("## Error: Environment import failed: errno = %d\n",
+  errno);
 
gd->flags |= GD_FLG_ENV_READY;
gd->flags |= GD_FLG_ENV_DEFAULT;

base-commit: 22d58e60ffb5484d912f26b9c3533eff1d3d3de9
-- 
git-series 0.9.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot