diff mbox series

[fixup] kunit: use --build_dir=.kunit as default

Message ID 20200526183436.47026-1-vitor@massaru.org (mailing list archive)
State New
Headers show
Series [fixup] kunit: use --build_dir=.kunit as default | expand

Commit Message

Vitor Massaru Iha May 26, 2020, 6:34 p.m. UTC
To make KUnit easier to use, and to avoid overwriting object and
.config files, the default KUnit build directory is set to .kunit

 * Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205221

Fixed up minor merge conflicts - Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
version after merge on kunit brach:
 * fix identation (tabs instead of spaces)
---
 tools/testing/kunit/kunit.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Shuah Khan May 26, 2020, 10:29 p.m. UTC | #1
On 5/26/20 12:34 PM, Vitor Massaru Iha wrote:
> To make KUnit easier to use, and to avoid overwriting object and
> .config files, the default KUnit build directory is set to .kunit
> 
>   * Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205221
> 
> Fixed up minor merge conflicts - Shuah Khan <skhan@linuxfoundation.org>
> 
> Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
> Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
> version after merge on kunit brach:
>   * fix identation (tabs instead of spaces)

You mentioned spaces breaking python. Please include the python
errors and make it clear in the change log what is fixes.

thanks,
-- Shuah
Vitor Massaru Iha May 26, 2020, 11:41 p.m. UTC | #2
On Tue, 2020-05-26 at 16:29 -0600, Shuah Khan wrote:
> On 5/26/20 12:34 PM, Vitor Massaru Iha wrote:
> > To make KUnit easier to use, and to avoid overwriting object and
> > .config files, the default KUnit build directory is set to .kunit
> > 
> >   * Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205221
> > 
> > Fixed up minor merge conflicts - Shuah Khan <
> > skhan@linuxfoundation.org>
> > 
> > Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
> > Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
> > Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> > ---
> > version after merge on kunit brach:
> >   * fix identation (tabs instead of spaces)
> 
> You mentioned spaces breaking python. Please include the python
> errors and make it clear in the change log what is fixes.

Of course, I will add this.
> 
> thanks,
> -- Shuah
>
diff mbox series

Patch

diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index b01838b6f5f9..b3490271a103 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -169,7 +169,7 @@  def add_common_opts(parser):
 	parser.add_argument('--build_dir',
 			    help='As in the make command, it specifies the build '
 			    'directory.',
-			    type=str, default='', metavar='build_dir')
+                            type=str, default='.kunit', metavar='build_dir')
 	parser.add_argument('--make_options',
 			    help='X=Y make option, can be repeated.',
 			    action='append')
@@ -245,12 +245,11 @@  def main(argv, linux=None):
 	cli_args = parser.parse_args(argv)
 
 	if cli_args.subcommand == 'run':
-		if cli_args.build_dir:
-			if not os.path.exists(cli_args.build_dir):
-				os.mkdir(cli_args.build_dir)
-			kunit_kernel.kunitconfig_path = os.path.join(
-				cli_args.build_dir,
-				kunit_kernel.kunitconfig_path)
+		if not os.path.exists(cli_args.build_dir):
+			os.mkdir(cli_args.build_dir)
+		kunit_kernel.kunitconfig_path = os.path.join(
+			cli_args.build_dir,
+			kunit_kernel.kunitconfig_path)
 
 		if not linux:
 			linux = kunit_kernel.LinuxSourceTree()