Skip to contentSkip to conversation

kunit: use --build_dir=.kunit as default

PATCH In review Vitor Massaru Iha 2 participants 3 messages May 27, 2020 – May 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kunit: use --build_dir=.kunit as default

To make KUnit easier to use, and to avoid overwriting object and .config files, the default KUnit build directory is set to .kunit

Fixed up minor merge conflicts - Shuah Khan <[email protected]>

Fixed this identation error exchanging spaces for tabs between lines 248 and 252:

tools/testing/kunit/kunit.py run --defconfig

File "tools/testing/kunit/kunit.py", line 254
if not linux:
^
TabError: inconsistent use of tabs and spaces in indentation

---
version after merge on kunit brach:
v1:
* fix identation (tabs instead of spaces)

v2:
* fix v1 changelog description: fix identation
(spaces instead of tabs, lines 248-252);
* add python error message on commit message;
* fix Link tag on commit message.

---
 tools/testing/kunit/kunit.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
tools/testing/kunit/kunit.py +6 -7
index b01838b6f5f9..b3490271a103 100755
@@ -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()
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 15 lines · Vitor Massaru Iha

To make KUnit easier to use, and to avoid overwriting object and .config files, the default KUnit build directory is set to .kunit

Fixed up minor merge conflicts - Shuah Khan <[email protected]>

Fixed this identation error exchanging spaces for tabs between lines 248 and 252:

tools/testing/kunit/kunit.py run --defconfig

File "tools/testing/kunit/kunit.py", line 254
if not linux:
^
TabError: inconsistent use of tabs and spaces in indentation

Quoted 4 lines

Vitor,

This patch doesn't apply. Can you change to subject to be unique Fix TabError and do the patch on top of linux-kselftest kunit

I think you did this, but I can't apply this on top:

https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit

thanks,
-- Shuah

#2 lore raw
Quoted 22 lines · Shuah Khan
Quoted 15 lines · Vitor Massaru Iha

To make KUnit easier to use, and to avoid overwriting object and .config files, the default KUnit build directory is set to .kunit

Fixed up minor merge conflicts - Shuah Khan <[email protected]>

Fixed this identation error exchanging spaces for tabs between lines 248 and 252:

tools/testing/kunit/kunit.py run --defconfig

File "tools/testing/kunit/kunit.py", line 254
if not linux:
^
TabError: inconsistent use of tabs and spaces in indentation

Quoted 4 lines
Quoted 9 lines

Vitor,

This patch doesn't apply. Can you change to subject to be unique Fix TabError and do the patch on top of linux-kselftest kunit

I think you did this, but I can't apply this on top:

https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit

Sure, I'll do that.

Quoted 2 lines

thanks,
-- Shuah