linux-sg2042/tools/testing/kunit
Vitor Massaru Iha 01397e822a kunit: Fix TabError, remove defconfig code and handle when there is no kunitconfig
The identation before this code
(`if not os.path.exists(cli_args.build_dir):``)
was with spaces instead of tabs after fixed up merge conflits,
this commit revert spaces to tabs:

[iha@bbking linux]$ tools/testing/kunit/kunit.py run
  File "tools/testing/kunit/kunit.py", line 247
    if not linux:
                ^
TabError: inconsistent use of tabs and spaces in indentation

[iha@bbking linux]$ tools/testing/kunit/kunit.py run
Traceback (most recent call last):
  File "tools/testing/kunit/kunit.py", line 338, in <module>
    main(sys.argv[1:])
  File "tools/testing/kunit/kunit.py", line 215, in main
    add_config_opts(config_parser)

[iha@bbking linux]$ tools/testing/kunit/kunit.py run
Traceback (most recent call last):
  File "tools/testing/kunit/kunit.py", line 337, in <module>
    main(sys.argv[1:])
  File "tools/testing/kunit/kunit.py", line 255, in main
    result = run_tests(linux, request)
  File "tools/testing/kunit/kunit.py", line 133, in run_tests
    request.defconfig,
AttributeError: 'KunitRequest' object has no attribute 'defconfig'

Handles when there is no .kunitconfig, the error due to merge conflicts
between the following:

commit 9bdf64b351 ("kunit: use KUnit defconfig by default")
commit 45ba7a893a ("kunit: kunit_tool: Separate out
	config/build/exec/parse")

[iha@bbking linux]$ tools/testing/kunit/kunit.py run
Traceback (most recent call last):
  File "tools/testing/kunit/kunit.py", line 335, in <module>
    main(sys.argv[1:])
  File "tools/testing/kunit/kunit.py", line 246, in main
    linux = kunit_kernel.LinuxSourceTree()
  File "../tools/testing/kunit/kunit_kernel.py", line 109, in __init__
    self._kconfig.read_from_file(kunitconfig_path)
  File "t../ools/testing/kunit/kunit_config.py", line 88, in read_from_file
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-06-01 14:14:07 -06:00
..
configs kunit: Run all KUnit tests through allyesconfig 2020-03-20 16:17:39 -06:00
test_data kunit: tool: add missing test data file content 2020-03-26 14:11:12 -06:00
.gitattributes kunit: kunit_parser: make parser more robust 2020-03-20 16:15:57 -06:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kunit.py kunit: Fix TabError, remove defconfig code and handle when there is no kunitconfig 2020-06-01 14:14:07 -06:00
kunit_config.py kunit: kunit_tool: Allow .kunitconfig to disable config items 2020-03-25 12:13:16 -06:00
kunit_kernel.py kunit: add --make_options 2020-03-23 17:08:22 -06:00
kunit_parser.py kunit: subtests should be indented 4 spaces according to TAP 2020-03-26 14:08:41 -06:00
kunit_tool_test.py kunit: kunit_tool: Separate out config/build/exec/parse 2020-05-11 16:53:40 -06:00