amurzeau created this revision. amurzeau added reviewers: njames93, alexfh, kazu, dougpuob. Herald added a subscriber: xazax.hun. Herald added a project: All. amurzeau requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits.
The previous way to test hungarian notation doesn't check CHECK-FIXES. This will allow readability-identifier-naming tests of Hungarian notation to keep the use of an external .clang-tidy file (not embedded within the .cpp test file) and properly check CHECK-FIXES. Also, it turns out the hungarian notation tests use the wrong .clang-tidy file, so fix that too to make these tests ok. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D144037 Files: clang-tools-extra/test/clang-tidy/check_clang_tidy.py clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp @@ -1,5 +1,4 @@ -// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \ -// RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s +// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy // clang-format off typedef signed char int8_t; // NOLINT Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp @@ -1,5 +1,4 @@ -// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \ -// RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s +// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy // clang-format off typedef signed char int8_t; // NOLINT Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py =================================================================== --- clang-tools-extra/test/clang-tidy/check_clang_tidy.py +++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py @@ -108,7 +108,7 @@ # auto-detection logic can discover a ".clang-tidy" file that is not related to # the test. if not any( - [arg.startswith('-config=') for arg in self.clang_tidy_extra_args]): + [arg.startswith('-config=') or arg.startswith('-config-file=') for arg in self.clang_tidy_extra_args]): self.clang_tidy_extra_args.append('-config={}') if extension in ['.m', '.mm']:
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp @@ -1,5 +1,4 @@ -// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \ -// RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s +// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy // clang-format off typedef signed char int8_t; // NOLINT Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp @@ -1,5 +1,4 @@ -// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \ -// RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s +// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy // clang-format off typedef signed char int8_t; // NOLINT Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py =================================================================== --- clang-tools-extra/test/clang-tidy/check_clang_tidy.py +++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py @@ -108,7 +108,7 @@ # auto-detection logic can discover a ".clang-tidy" file that is not related to # the test. if not any( - [arg.startswith('-config=') for arg in self.clang_tidy_extra_args]): + [arg.startswith('-config=') or arg.startswith('-config-file=') for arg in self.clang_tidy_extra_args]): self.clang_tidy_extra_args.append('-config={}') if extension in ['.m', '.mm']:
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits