clang-tidy: Make tests more hermetic
Make check_clang_tidy.py not just pass -format-style=none by default but a full -config={}. Without this, with a build dir outside of the llvm root dir and a .clang-tidy config further up that contains CheckOptions: - key: modernize-use-default-member-init.UseAssignment value: 1 these tests would fail: Clang Tools :: clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-modernize-use-default-member-init.cpp Clang Tools :: clang-tidy/checkers/modernize-use-default-member-init-bitfield.cpp Clang Tools :: clang-tidy/checkers/modernize-use-default-member-init.cpp After this change, they pass fine, despite the unrelated .clang-tidy file further up.
This commit is contained in:
parent
db60e64036
commit
f1e0944fe5
|
@ -61,12 +61,12 @@ def run_test_once(args, extra_args):
|
|||
clang_extra_args = clang_tidy_extra_args[i + 1:]
|
||||
clang_tidy_extra_args = clang_tidy_extra_args[:i]
|
||||
|
||||
# If the test does not specify a formatting style, force "none"; otherwise
|
||||
# If the test does not specify a config style, force an empty one; otherwise
|
||||
# autodetection logic can discover a ".clang-tidy" file that is not related to
|
||||
# the test.
|
||||
if not any(
|
||||
[arg.startswith('-format-style=') for arg in clang_tidy_extra_args]):
|
||||
clang_tidy_extra_args.append('-format-style=none')
|
||||
[arg.startswith('-config=') for arg in clang_tidy_extra_args]):
|
||||
clang_tidy_extra_args.append('-config={}')
|
||||
|
||||
if extension in ['.m', '.mm']:
|
||||
clang_extra_args = ['-fobjc-abi-version=2', '-fobjc-arc', '-fblocks'] + \
|
||||
|
|
Loading…
Reference in New Issue