[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABVgOS=t4q2EOqvmNrDWJsfSV73GQpecQCOpoH_nMJt-ARuNJw@mail.gmail.com>
Date: Fri, 30 Oct 2020 10:36:59 +0800
From: David Gow <davidgow@...gle.com>
To: Daniel Latypov <dlatypov@...gle.com>
Cc: Brendan Higgins <brendanhiggins@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] kunit: tool: print out stderr from make (like build warnings)
On Fri, Oct 30, 2020 at 6:10 AM Daniel Latypov <dlatypov@...gle.com> wrote:
>
> Currently the tool redirects make stdout + stderr, and only shows them
> if the make command fails.
> This means build warnings aren't shown to the user.
>
> This change prints the contents of stderr even if make succeeds, under
> the assumption these are only build warnings or other messages the user
> likely wants to see.
>
> We drop stdout from the raised exception since we can no longer easily
> collate stdout and stderr and just showing the stderr seems fine.
>
> Example with a warning:
>
> [14:56:35] Building KUnit Kernel ...
> ../lib/kunit/kunit-test.c: In function ‘kunit_test_successful_try’:
> ../lib/kunit/kunit-test.c:19:6: warning: unused variable ‘unused’ [-Wunused-variable]
> 19 | int unused;
> | ^~~~~~
>
> [14:56:40] Starting KUnit Kernel ...
>
> Note the stderr has a trailing \n, and since we use print, we add
> another, but it helps separate make and kunit.py output.
>
> Example with a build error:
>
> [15:02:45] Building KUnit Kernel ...
> ERROR:root:../lib/kunit/kunit-test.c: In function ‘kunit_test_successful_try’:
> ../lib/kunit/kunit-test.c:19:2: error: unknown type name ‘invalid_type’
> 19 | invalid_type *test = data;
> | ^~~~~~~~~~~~
> ...
>
> Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
> ---
Thanks a lot -- this was really bugging me, and works great.
Reviewed-by: David Gow <davidgow@...gle.com>
Powered by blists - more mailing lists