Skip to content

Commit ddbd60c

Browse files
ihashuahkh
authored andcommitted
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 * Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205221 Fixed up minor merge conflicts - Shuah Khan <[email protected]> Signed-off-by: Vitor Massaru Iha <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent c4714b0 commit ddbd60c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tools/testing/kunit/kunit.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def add_common_opts(parser):
169169
parser.add_argument('--build_dir',
170170
help='As in the make command, it specifies the build '
171171
'directory.',
172-
type=str, default='', metavar='build_dir')
172+
type=str, default='.kunit', metavar='build_dir')
173173
parser.add_argument('--make_options',
174174
help='X=Y make option, can be repeated.',
175175
action='append')
@@ -245,12 +245,11 @@ def main(argv, linux=None):
245245
cli_args = parser.parse_args(argv)
246246

247247
if cli_args.subcommand == 'run':
248-
if cli_args.build_dir:
249-
if not os.path.exists(cli_args.build_dir):
250-
os.mkdir(cli_args.build_dir)
251-
kunit_kernel.kunitconfig_path = os.path.join(
252-
cli_args.build_dir,
253-
kunit_kernel.kunitconfig_path)
248+
if not os.path.exists(cli_args.build_dir):
249+
os.mkdir(cli_args.build_dir)
250+
kunit_kernel.kunitconfig_path = os.path.join(
251+
cli_args.build_dir,
252+
kunit_kernel.kunitconfig_path)
254253

255254
if not linux:
256255
linux = kunit_kernel.LinuxSourceTree()

0 commit comments

Comments
 (0)