Index: clang-tools-extra/clang-tidy/add_new_check.py =================================================================== --- clang-tools-extra/clang-tidy/add_new_check.py +++ clang-tools-extra/clang-tidy/add_new_check.py @@ -278,8 +278,9 @@ # Adds a test for the check. def write_test(module_path, module, check_name, test_extension): check_name_dashes = module + '-' + check_name - filename = os.path.normpath(os.path.join(module_path, '../../test/clang-tidy/checkers', - check_name_dashes + '.' + test_extension)) + filename = os.path.normpath(os.path.join( + module_path, '..', '..', 'test', 'clang-tidy', 'checkers', + module, check_name + '.' + test_extension)) print('Creating %s...' % filename) with io.open(filename, 'w', encoding='utf8', newline='\n') as f: f.write("""// RUN: %%check_clang_tidy %%s %(check_name_dashes)s %%t Index: clang-tools-extra/docs/clang-tidy/Contributing.rst =================================================================== --- clang-tools-extra/docs/clang-tidy/Contributing.rst +++ clang-tools-extra/docs/clang-tidy/Contributing.rst @@ -582,7 +582,7 @@ substitutions and distinct function and variable names in the test code. Here's an example of a test using the ``check_clang_tidy.py`` script (the full -source code is at `test/clang-tidy/google-readability-casting.cpp`_): +source code is at `test/clang-tidy/checkers/google/readability-casting.cpp`_): .. code-block:: c++ @@ -632,12 +632,18 @@ expansions/instantiations. If you need multiple files to exercise all the aspects of your check, it is -recommended you place them in a subdirectory named for the check under ``Inputs``. -This keeps the test directory from getting cluttered. +recommended you place them in a subdirectory named for the check under the ``Inputs`` +directory for the module containing your check. This keeps the test directory from +getting cluttered. + +If you need to validate how your check interacts with system header files, a set +of simulated system header files is located in the ``checkers/Inputs/Headers`` +directory. The path to this directory is available in a lit test with the variable +``%clang_tidy_headers``. .. _lit: https://llvm.org/docs/CommandGuide/lit.html .. _FileCheck: https://llvm.org/docs/CommandGuide/FileCheck.html -.. _test/clang-tidy/google-readability-casting.cpp: https://reviews.llvm.org/diffusion/L/browse/clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp +.. _test/clang-tidy/checkers/google/readability-casting.cpp: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.cpp Out-of-tree check plugins ------------------------- Index: clang-tools-extra/test/clang-tidy/checkers/altera/kernel-name-restriction.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/altera/kernel-name-restriction.cpp +++ clang-tools-extra/test/clang-tidy/checkers/altera/kernel-name-restriction.cpp @@ -1,5 +1,5 @@ -// RUN: %check_clang_tidy %s altera-kernel-name-restriction %t -- -- -I%S/Inputs/altera-kernel-name-restriction -// RUN: %check_clang_tidy -check-suffix=UPPERCASE %s altera-kernel-name-restriction %t -- -- -I%S/Inputs/altera-kernel-name-restriction/uppercase -DUPPERCASE +// RUN: %check_clang_tidy %s altera-kernel-name-restriction %t -- -- -I%S/Inputs/kernel-name-restriction +// RUN: %check_clang_tidy -check-suffix=UPPERCASE %s altera-kernel-name-restriction %t -- -- -I%S/Inputs/kernel-name-restriction/uppercase -DUPPERCASE #ifdef UPPERCASE // The warning should be triggered regardless of capitalization Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/argument-comment.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/argument-comment.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/argument-comment.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- -- -I %S/Inputs/bugprone-argument-comment +// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- -- -I %S/Inputs/argument-comment // FIXME: clang-tidy should provide a -verify mode to make writing these checks // easier and more accurate. Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-in-initialization-strlen.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-in-initialization-strlen.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-in-initialization-strlen.c @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-c.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-before-safe.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-before-safe.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-before-safe.c @@ -2,7 +2,7 @@ // RUN: -config="{CheckOptions: \ // RUN: [{key: bugprone-not-null-terminated-result.WantToUseSafeFunctions, \ // RUN: value: true}]}" \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-c.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe-cxx.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe-cxx.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe-cxx.cpp @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c++11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c++11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-cxx.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe-other.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe-other.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe-other.c @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-c.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-memcpy-safe.c @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-c.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-stdc-want-lib-ext1-not-a-literal.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-stdc-want-lib-ext1-not-a-literal.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-stdc-want-lib-ext1-not-a-literal.c @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-c.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-strlen.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-strlen.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-strlen.c @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result // FIXME: Something wrong with the APInt un/signed conversion on Windows: // in 'strncmp(str6, "string", 7);' it tries to inject '4294967302' as length. Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-undef-stdc-want-lib-ext1.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-undef-stdc-want-lib-ext1.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-undef-stdc-want-lib-ext1.c @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-c.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-wcslen.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-wcslen.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-wcslen.cpp @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c++11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c++11 -I %S/Inputs/not-null-terminated-result // FIXME: Something wrong with the APInt un/signed conversion on Windows: // in 'wcsncmp(wcs6, L"string", 7);' it tries to inject '4294967302' as length. Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-wmemcpy-safe-cxx.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-wmemcpy-safe-cxx.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/not-null-terminated-result-wmemcpy-safe-cxx.cpp @@ -1,5 +1,5 @@ // RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \ -// RUN: -- -std=c++11 -I %S/Inputs/bugprone-not-null-terminated-result +// RUN: -- -std=c++11 -I %S/Inputs/not-null-terminated-result #include "not-null-terminated-result-cxx.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier-invert.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier-invert.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier-invert.cpp @@ -3,8 +3,8 @@ // RUN: {key: bugprone-reserved-identifier.Invert, value: true}, \ // RUN: {key: bugprone-reserved-identifier.AllowedIdentifiers, value: std;reference_wrapper;ref;cref;type;get}, \ // RUN: ]}' -- \ -// RUN: -I%S/Inputs/bugprone-reserved-identifier \ -// RUN: -isystem %S/Inputs/bugprone-reserved-identifier/system +// RUN: -I%S/Inputs/reserved-identifier \ +// RUN: -isystem %S/Inputs/reserved-identifier/system namespace std { Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s bugprone-reserved-identifier %t -- -- \ -// RUN: -I%S/Inputs/bugprone-reserved-identifier \ -// RUN: -isystem %S/Inputs/bugprone-reserved-identifier/system +// RUN: -I%S/Inputs/reserved-identifier \ +// RUN: -isystem %S/Inputs/reserved-identifier/system // no warnings expected without -header-filter= #include "user-header.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler-minimal.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler-minimal.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler-minimal.c @@ -1,7 +1,7 @@ // RUN: %check_clang_tidy %s bugprone-signal-handler %t \ // RUN: -config='{CheckOptions: \ // RUN: [{key: bugprone-signal-handler.AsyncSafeFunctionSet, value: "minimal"}]}' \ -// RUN: -- -isystem %S/Inputs/Headers +// RUN: -- -isystem %clang_tidy_headers #include "signal.h" #include "stdlib.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler-posix.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler-posix.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler-posix.c @@ -1,7 +1,7 @@ // RUN: %check_clang_tidy %s bugprone-signal-handler %t \ // RUN: -config='{CheckOptions: \ // RUN: [{key: bugprone-signal-handler.AsyncSafeFunctionSet, value: "POSIX"}]}' \ -// RUN: -- -isystem %S/Inputs/Headers +// RUN: -- -isystem %clang_tidy_headers #include "signal.h" #include "stdlib.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.c +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.c @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-signal-handler %t -- -- -isystem %S/Inputs/Headers +// RUN: %check_clang_tidy %s bugprone-signal-handler %t -- -- -isystem %clang_tidy_headers #include "signal.h" #include "stdlib.h" Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-include.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-include.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-include.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-suspicious-include %t -- -- -isystem %S/Inputs/Headers -fmodules +// RUN: %check_clang_tidy %s bugprone-suspicious-include %t -- -- -isystem %clang_tidy_headers -fmodules // clang-format off Index: clang-tools-extra/test/clang-tidy/checkers/bugprone/unchecked-optional-access.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/bugprone/unchecked-optional-access.cpp +++ clang-tools-extra/test/clang-tidy/checkers/bugprone/unchecked-optional-access.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s bugprone-unchecked-optional-access %t -- -- -I %S/Inputs/ +// RUN: %check_clang_tidy %s bugprone-unchecked-optional-access %t -- -- -I %S/Inputs/unchecked-optional-access #include "absl/types/optional.h" Index: clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp +++ clang-tools-extra/test/clang-tidy/checkers/cert/dcl58-cpp.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cert-dcl58-cpp %t -- -- -std=c++1z -I %S/Inputs/Headers +// RUN: %check_clang_tidy %s cert-dcl58-cpp %t -- -- -std=c++1z -I %clang_tidy_headers #include "system-header-simulation.h" Index: clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp +++ clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp @@ -3,7 +3,7 @@ // RUN: clang-tidy %t.cpp -checks='-*,cert-dcl16-c' -fix -- -I %S // RUN: clang-tidy %t.cpp -checks='-*,cert-dcl16-c' -warnings-as-errors='-*,cert-dcl16-c' -- -I %S -#include "readability-uppercase-literal-suffix.h" +#include "../readability/uppercase-literal-suffix.h" void integer_suffix() { static constexpr auto v0 = __LINE__; // synthetic Index: clang-tools-extra/test/clang-tidy/checkers/google/objc-function-naming.m =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/google/objc-function-naming.m +++ clang-tools-extra/test/clang-tidy/checkers/google/objc-function-naming.m @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s google-objc-function-naming %t -- -- -isystem %S/Inputs/Headers +// RUN: %check_clang_tidy %s google-objc-function-naming %t -- -- -isystem %clang_tidy_headers #include Index: clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.c =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.c +++ clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.c @@ -8,7 +8,7 @@ #ifdef TEST_INCLUDE #undef TEST_INCLUDE -#include "google-readability-casting.c" +#include "readability-casting.c" #else Index: clang-tools-extra/test/clang-tidy/checkers/hicpp/signed-bitwise-standard-types.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/hicpp/signed-bitwise-standard-types.cpp +++ clang-tools-extra/test/clang-tidy/checkers/hicpp/signed-bitwise-standard-types.cpp @@ -1,7 +1,7 @@ // RUN: clang-tidy %s -checks='-*,hicpp-signed-bitwise' -- -std=c++11 // FIXME: Make the test work in all language modes. -#include "hicpp-signed-bitwise-standard-types.h" +#include "signed-bitwise-standard-types.h" void pure_bitmask_types() { // std::locale::category Index: clang-tools-extra/test/clang-tidy/checkers/llvm/include-order.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/llvm/include-order.cpp +++ clang-tools-extra/test/clang-tidy/checkers/llvm/include-order.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s llvm-include-order %t -- -- -isystem %S/Inputs/Headers +// RUN: %check_clang_tidy %s llvm-include-order %t -- -- -isystem %clang_tidy_headers // CHECK-MESSAGES: [[@LINE+2]]:1: warning: #includes are not sorted properly #include "j.h" Index: clang-tools-extra/test/clang-tidy/checkers/llvmlibc/restrict-system-libc-headers.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/llvmlibc/restrict-system-libc-headers.cpp +++ clang-tools-extra/test/clang-tidy/checkers/llvmlibc/restrict-system-libc-headers.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s llvmlibc-restrict-system-libc-headers %t \ -// RUN: -- -- -isystem %S/Inputs/llvmlibc/system \ -// RUN: -resource-dir %S/Inputs/llvmlibc/resource +// RUN: -- -- -isystem %S/Inputs/system \ +// RUN: -resource-dir %S/Inputs/resource #include // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include stdio.h not allowed Index: clang-tools-extra/test/clang-tidy/checkers/misc/unconventional-assign-operator.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/misc/unconventional-assign-operator.cpp +++ clang-tools-extra/test/clang-tidy/checkers/misc/unconventional-assign-operator.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-unconventional-assign-operator %t -- -- -isystem %S/Inputs/Headers -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s misc-unconventional-assign-operator %t -- -- -fno-delayed-template-parsing namespace std { template Index: clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls-cxx17.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls-cxx17.cpp +++ clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls-cxx17.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++17-or-later %s misc-unused-using-decls %t -- --fix-notes -- -fno-delayed-template-parsing -isystem %S/Inputs/ +// RUN: %check_clang_tidy -std=c++17-or-later %s misc-unused-using-decls %t -- --fix-notes -- -fno-delayed-template-parsing namespace ns { Index: clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls.cpp +++ clang-tools-extra/test/clang-tidy/checkers/misc/unused-using-decls.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-unused-using-decls %t -- --fix-notes -- -fno-delayed-template-parsing -isystem %S/Inputs/ +// RUN: %check_clang_tidy %s misc-unused-using-decls %t -- --fix-notes -- -fno-delayed-template-parsing -isystem %S/Inputs // ----- Definitions ----- template class vector {}; Index: clang-tools-extra/test/clang-tidy/checkers/modernize/concat-nested-namespaces.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/concat-nested-namespaces.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/concat-nested-namespaces.cpp @@ -1,10 +1,10 @@ -// RUN: cp %S/Inputs/modernize-concat-nested-namespaces/modernize-concat-nested-namespaces.h %T/modernize-concat-nested-namespaces.h +// RUN: cp %S/Inputs/concat-nested-namespaces/modernize-concat-nested-namespaces.h %T/modernize-concat-nested-namespaces.h // RUN: %check_clang_tidy -std=c++17 %s modernize-concat-nested-namespaces %t -- -header-filter=".*" -- -I %T -// RUN: FileCheck -input-file=%T/modernize-concat-nested-namespaces.h %S/Inputs/modernize-concat-nested-namespaces/modernize-concat-nested-namespaces.h -check-prefix=CHECK-FIXES +// RUN: FileCheck -input-file=%T/modernize-concat-nested-namespaces.h %S/Inputs/concat-nested-namespaces/modernize-concat-nested-namespaces.h -check-prefix=CHECK-FIXES // Restore header file and re-run with c++20: -// RUN: cp %S/Inputs/modernize-concat-nested-namespaces/modernize-concat-nested-namespaces.h %T/modernize-concat-nested-namespaces.h +// RUN: cp %S/Inputs/concat-nested-namespaces/modernize-concat-nested-namespaces.h %T/modernize-concat-nested-namespaces.h // RUN: %check_clang_tidy -std=c++20 %s modernize-concat-nested-namespaces %t -- -header-filter=".*" -- -I %T -// RUN: FileCheck -input-file=%T/modernize-concat-nested-namespaces.h %S/Inputs/modernize-concat-nested-namespaces/modernize-concat-nested-namespaces.h -check-prefix=CHECK-FIXES +// RUN: FileCheck -input-file=%T/modernize-concat-nested-namespaces.h %S/Inputs/concat-nested-namespaces/modernize-concat-nested-namespaces.h -check-prefix=CHECK-FIXES #include "modernize-concat-nested-namespaces.h" // CHECK-MESSAGES-DAG: modernize-concat-nested-namespaces.h:1:1: warning: nested namespaces can be concatenated [modernize-concat-nested-namespaces] Index: clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-cxx03.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-cxx03.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-cxx03.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++98 %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers +// RUN: %check_clang_tidy -std=c++98 %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/deprecated-headers #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers] Index: clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-cxx11.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-cxx11.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++11-or-later %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/modernize-deprecated-headers +// RUN: %check_clang_tidy -std=c++11-or-later %s modernize-deprecated-headers %t -- -extra-arg-before=-isystem%S/Inputs/deprecated-headers #include // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers] Index: clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-extern-c.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-extern-c.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/deprecated-headers-extern-c.cpp @@ -4,19 +4,19 @@ // absolute file paths which is sorted by clang-tidy prior emitting. // // RUN: mkdir -p %t/sys && mkdir -p %t/usr \ -// RUN: && cp %S/Inputs/modernize-deprecated-headers/mysystemlib.h %t/sys/mysystemlib.h \ -// RUN: && cp %S/Inputs/modernize-deprecated-headers/mylib.h %t/usr/mylib.h +// RUN: && cp %S/Inputs/deprecated-headers/mysystemlib.h %t/sys/mysystemlib.h \ +// RUN: && cp %S/Inputs/deprecated-headers/mylib.h %t/usr/mylib.h // RUN: %check_clang_tidy -std=c++11 %s modernize-deprecated-headers %t \ // RUN: -check-suffixes=DEFAULT \ // RUN: --header-filter='.*' --system-headers \ -// RUN: -- -I %t/usr -isystem %t/sys -isystem %S/Inputs/modernize-deprecated-headers +// RUN: -- -I %t/usr -isystem %t/sys -isystem %S/Inputs/deprecated-headers // RUN: %check_clang_tidy -std=c++11 %s modernize-deprecated-headers %t \ // RUN: -check-suffixes=DEFAULT,CHECK-HEADER-FILE \ // RUN: -config="{CheckOptions: [{key: modernize-deprecated-headers.CheckHeaderFile, value: 'true'}]}" \ // RUN: --header-filter='.*' --system-headers \ -// RUN: -- -I %t/usr -isystem %t/sys -isystem %S/Inputs/modernize-deprecated-headers +// RUN: -- -I %t/usr -isystem %t/sys -isystem %S/Inputs/deprecated-headers // REQUIRES: system-linux Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-basic.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-basic.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-basic.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/loop-convert #include "structures.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-camelback.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-camelback.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-camelback.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-loop-convert %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'camelBack'}]}" \ -// RUN: -- -I %S/Inputs/modernize-loop-convert +// RUN: -- -I %S/Inputs/loop-convert #include "structures.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-extra.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-extra.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-extra.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/loop-convert #include "structures.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-lowercase.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-lowercase.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-lowercase.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-loop-convert %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'lower_case'}]}" \ -// RUN: -- -I %S/Inputs/modernize-loop-convert +// RUN: -- -I %S/Inputs/loop-convert #include "structures.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-negative.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-negative.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-negative.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -- -I %S/Inputs/loop-convert #include "structures.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-rewritten-binop.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-rewritten-binop.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-rewritten-binop.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++20 %s modernize-loop-convert %t -- -- -I %S/Inputs/modernize-loop-convert +// RUN: %check_clang_tidy -std=c++20 %s modernize-loop-convert %t -- -- -I %S/Inputs/loop-convert namespace std { struct strong_ordering { Index: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-uppercase.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-uppercase.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-uppercase.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-loop-convert %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'UPPER_CASE'}]}" \ -// RUN: -- -I %S/Inputs/modernize-loop-convert +// RUN: -- -I %S/Inputs/loop-convert #include "structures.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/macro-to-enum.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/macro-to-enum.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/macro-to-enum.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-macro-to-enum %t -- -- -I%S/Inputs/modernize-macro-to-enum -fno-delayed-template-parsing +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-macro-to-enum %t -- -- -I%S/Inputs/macro-to-enum -fno-delayed-template-parsing // C++14 or later required for binary literals. #if 1 Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared-header.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared-header.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared-header.cpp @@ -5,7 +5,7 @@ // RUN: {key: modernize-make-shared.MakeSmartPtrFunctionHeader, \ // RUN: value: 'make_shared_util.h'} \ // RUN: ]}" \ -// RUN: -- -I %S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/smart-ptr #include "shared_ptr.h" // CHECK-FIXES: #include "make_shared_util.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-make-shared %t -- -- -I %S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy %s modernize-make-shared %t -- -- -I %S/Inputs/smart-ptr #include "shared_ptr.h" // CHECK-FIXES: #include Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-cxx11.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-cxx11.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++11 %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy -std=c++11 %s modernize-make-unique %t -- -- -I %S/Inputs/smart-ptr #include "unique_ptr.h" // CHECK-FIXES: #include "unique_ptr.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-default-init.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-default-init.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-default-init.cpp @@ -3,7 +3,7 @@ // RUN: [{key: modernize-make-unique.IgnoreDefaultInitialization, \ // RUN: value: 'false'}] \ // RUN: }" \ -// RUN: -- -I %S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/smart-ptr #include "initializer_list.h" #include "unique_ptr.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-header.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-header.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-header.cpp @@ -5,7 +5,7 @@ // RUN: {key: modernize-make-unique.MakeSmartPtrFunctionHeader, \ // RUN: value: 'make_unique_util.h'} \ // RUN: ]}" \ -// RUN: -- -I %S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/smart-ptr #include "unique_ptr.h" // CHECK-FIXES: #include "make_unique_util.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-inaccessible-ctors.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-inaccessible-ctors.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-inaccessible-ctors.cpp @@ -1,5 +1,5 @@ -// RUN: %check_clang_tidy -std=c++14,c++17 -check-suffix=CXX-14-17 %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr -D CXX_14_17=1 -// RUN: %check_clang_tidy -std=c++20 -check-suffix=CXX-20 %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr -D CXX_20=1 +// RUN: %check_clang_tidy -std=c++14,c++17 -check-suffix=CXX-14-17 %s modernize-make-unique %t -- -- -I %S/Inputs/smart-ptr -D CXX_14_17=1 +// RUN: %check_clang_tidy -std=c++20 -check-suffix=CXX-20 %s modernize-make-unique %t -- -- -I %S/Inputs/smart-ptr -D CXX_20=1 #include "unique_ptr.h" // CHECK-FIXES: #include Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-macros.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-macros.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique-macros.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-make-unique.IgnoreMacros, value: false}]}" \ -// RUN: -- -I %S/Inputs/modernize-smart-ptr +// RUN: -- -I %S/Inputs/smart-ptr #include "unique_ptr.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/make-unique.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr +// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-make-unique %t -- -- -I %S/Inputs/smart-ptr #include "unique_ptr.h" #include "initializer_list.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-header.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-header.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-header.cpp @@ -1,4 +1,4 @@ -// RUN: cp %S/Inputs/modernize-pass-by-value/header.h %T/pass-by-value-header.h +// RUN: cp %S/Inputs/pass-by-value/header.h %T/pass-by-value-header.h // RUN: clang-tidy %s -checks='-*,modernize-pass-by-value' -header-filter='.*' -fix -- -std=c++11 -I %T | FileCheck %s -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:" // RUN: FileCheck -input-file=%T/pass-by-value-header.h %s -check-prefix=CHECK-FIXES // FIXME: Make the test work in all language modes. Index: clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-macro-header.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-macro-header.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-macro-header.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -isystem %S/Inputs/Headers +// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -isystem %clang_tidy_headers // CHECK-FIXES: #include Index: clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-multi-fixes.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-multi-fixes.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/pass-by-value-multi-fixes.cpp @@ -1,4 +1,4 @@ -// RUN: cat %S/Inputs/modernize-pass-by-value/header-with-fix.h > %T/pass-by-value-header-with-fix.h +// RUN: cat %S/Inputs/pass-by-value/header-with-fix.h > %T/pass-by-value-header-with-fix.h // RUN: sed -e 's#//.*$##' %s > %t.cpp // RUN: clang-tidy %t.cpp -checks='-*,modernize-pass-by-value' -header-filter='.*' -fix -- -std=c++11 -I %T | FileCheck %s -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:" // RUN: FileCheck -input-file=%t.cpp %s -check-prefix=CHECK-FIXES Index: clang-tools-extra/test/clang-tidy/checkers/modernize/replace-auto-ptr.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/replace-auto-ptr.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/replace-auto-ptr.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- -- -I %S/Inputs/modernize-replace-auto-ptr +// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- -- -I %S/Inputs/replace-auto-ptr // CHECK-FIXES: #include Index: clang-tools-extra/test/clang-tidy/checkers/modernize/use-auto-cast.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/use-auto-cast.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/use-auto-cast.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ // RUN: -config="{CheckOptions: [{key: modernize-use-auto.MinTypeNameLength, value: '0'}]}" \ -// RUN: -- -I %S/Inputs/modernize-use-auto -frtti +// RUN: -- -I %S/Inputs/use-auto -frtti struct A { virtual ~A() {} Index: clang-tools-extra/test/clang-tidy/checkers/modernize/use-auto-iterator.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/use-auto-iterator.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/use-auto-iterator.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-auto %t -- -- -I %S/Inputs/modernize-use-auto +// RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-auto %t -- -- -I %S/Inputs/use-auto // FIXME: Fix the checker to work in C++17 mode. #include "containers.h" Index: clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s modernize-use-using %t -- -- -I %S/Inputs/modernize-use-using/ +// RUN: %check_clang_tidy %s modernize-use-using %t -- -- -I %S/Inputs/use-using/ typedef int Type; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using] Index: clang-tools-extra/test/clang-tidy/checkers/mpi/buffer-deref.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/mpi/buffer-deref.cpp +++ clang-tools-extra/test/clang-tidy/checkers/mpi/buffer-deref.cpp @@ -1,5 +1,5 @@ // REQUIRES: static-analyzer -// RUN: %check_clang_tidy %s mpi-buffer-deref %t -- -- -I %S/Inputs/mpi-type-mismatch +// RUN: %check_clang_tidy %s mpi-buffer-deref %t -- -- -I %S/Inputs/type-mismatch #include "mpimock.h" Index: clang-tools-extra/test/clang-tidy/checkers/mpi/type-mismatch.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/mpi/type-mismatch.cpp +++ clang-tools-extra/test/clang-tidy/checkers/mpi/type-mismatch.cpp @@ -1,5 +1,5 @@ // REQUIRES: static-analyzer -// RUN: %check_clang_tidy %s mpi-type-mismatch %t -- -- -I %S/Inputs/mpi-type-mismatch +// RUN: %check_clang_tidy %s mpi-type-mismatch %t -- -- -I %S/Inputs/type-mismatch #include "mpimock.h" Index: clang-tools-extra/test/clang-tidy/checkers/objc/assert-equals.m =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/objc/assert-equals.m +++ clang-tools-extra/test/clang-tidy/checkers/objc/assert-equals.m @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s objc-assert-equals %t -- -- -I %S/Inputs/objc-assert +// RUN: %check_clang_tidy %s objc-assert-equals %t -- -- -I %S/Inputs/assert #include "XCTestAssertions.h" // Can't reference NSString directly so we use this getStr() instead. __typeof(@"abc") getStr(void) { Index: clang-tools-extra/test/clang-tidy/checkers/performance/move-constructor-init.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/performance/move-constructor-init.cpp +++ clang-tools-extra/test/clang-tidy/checkers/performance/move-constructor-init.cpp @@ -1,7 +1,7 @@ // RUN: %check_clang_tidy %s performance-move-constructor-init,modernize-pass-by-value %t -- \ // RUN: -config='{CheckOptions: \ // RUN: [{key: modernize-pass-by-value.ValuesOnly, value: true}]}' \ -// RUN: -- -isystem %S/Inputs/Headers +// RUN: -- -isystem %clang_tidy_headers #include Index: clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-header.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-header.cpp +++ clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-header.cpp @@ -1,8 +1,8 @@ // RUN: rm -rf %t // RUN: mkdir %t -// RUN: cp %S/Inputs/performance-unnecessary-value-param/header.h %t/header.h +// RUN: cp %S/Inputs/unnecessary-value-param/header.h %t/header.h // RUN: %check_clang_tidy %s performance-unnecessary-value-param %t/temp -- -- -I %t -// RUN: diff %t/header.h %S/Inputs/performance-unnecessary-value-param/header-fixed.h +// RUN: diff %t/header.h %S/Inputs/unnecessary-value-param/header-fixed.h #include "header.h" Index: clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-allow.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-allow.cpp +++ clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-allow.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s portability-restrict-system-includes %t \ // RUN: -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '*,-stddef.h'}]}" \ -// RUN: -- -isystem %S/Inputs/portability-restrict-system-includes/system +// RUN: -- -isystem %S/Inputs/restrict-system-includes/system // Test block-list functionality: allow all but stddef.h. Index: clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-disallow.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-disallow.cpp +++ clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-disallow.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s portability-restrict-system-includes %t \ // RUN: -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '-*,stddef.h'}]}" \ -// RUN: -- -isystem %S/Inputs/portability-restrict-system-includes/system +// RUN: -- -isystem %S/Inputs/restrict-system-includes/system // Test allow-list functionality: disallow all but stddef.h. Index: clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-glob.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-glob.cpp +++ clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-glob.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s portability-restrict-system-includes %t \ // RUN: -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: '-*,std*.h'}]}" \ -// RUN: -- -isystem %S/Inputs/portability-restrict-system-includes/system +// RUN: -- -isystem %S/Inputs/restrict-system-includes/system // Test glob functionality: disallow all headers except those that match // pattern "std*.h". Index: clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-transitive.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-transitive.cpp +++ clang-tools-extra/test/clang-tidy/checkers/portability/restrict-system-includes-transitive.cpp @@ -1,6 +1,6 @@ // RUN: rm -rf %T/Headers // RUN: mkdir %T/Headers -// RUN: cp -r %S/Inputs/portability-restrict-system-includes %T/Headers/portability-restrict-system-includes +// RUN: cp -r %S/Inputs/restrict-system-includes %T/Headers/portability-restrict-system-includes // RUN: %check_clang_tidy -std=c++11 %s portability-restrict-system-includes %t \ // RUN: -- -config="{CheckOptions: [{key: portability-restrict-system-includes.Includes, value: 'transitive.h,s.h'}]}" \ // RUN: -system-headers -header-filter=.* \ Index: clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h +++ clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h @@ -2,13 +2,13 @@ #define READABILITY_DUPLICATE_INCLUDE_H extern int g; -#include "readability-duplicate-include2.h" +#include "duplicate-include2.h" extern int h; -#include "readability-duplicate-include2.h" +#include "duplicate-include2.h" extern int i; // CHECK-MESSAGES: :[[@LINE-2]]:1: warning: duplicate include // CHECK-FIXES: {{^extern int g;$}} -// CHECK-FIXES-NEXT: {{^#include "readability-duplicate-include2.h"$}} +// CHECK-FIXES-NEXT: {{^#include "duplicate-include2.h"$}} // CHECK-FIXES-NEXT: {{^extern int h;$}} // CHECK-FIXES-NEXT: {{^extern int i;$}} Index: clang-tools-extra/test/clang-tidy/checkers/readability/duplicate-include.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/duplicate-include.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/duplicate-include.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-duplicate-include %t -- -- -isystem %S/Inputs/readability-duplicate-include/system -I %S/Inputs/readability-duplicate-include +// RUN: %check_clang_tidy %s readability-duplicate-include %t -- -- -isystem %S/Inputs/duplicate-include/system -I %S/Inputs/duplicate-include int a; #include @@ -23,13 +23,13 @@ // CHECK-FIXES-NEXT: {{^int f;$}} int g; -#include "readability-duplicate-include.h" +#include "duplicate-include.h" int h; -#include "readability-duplicate-include.h" +#include "duplicate-include.h" int i; // CHECK-MESSAGES: :[[@LINE-2]]:1: warning: duplicate include // CHECK-FIXES: {{^int g;$}} -// CHECK-FIXES-NEXT: {{^#include "readability-duplicate-include.h"$}} +// CHECK-FIXES-NEXT: {{^#include "duplicate-include.h"$}} // CHECK-FIXES-NEXT: {{^int h;$}} // CHECK-FIXES-NEXT: {{^int i;$}} 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,4 +1,4 @@ -// RUN: clang-tidy %s --config-file=%S/Inputs/readability-identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \ +// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s // clang-format off 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,4 +1,4 @@ -// RUN: clang-tidy %s --config-file=%S/Inputs/readability-identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \ +// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \ // RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s // clang-format off Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-multiple-styles.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-multiple-styles.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-multiple-styles.cpp @@ -2,7 +2,7 @@ // RUN: rm -rf %theaders // RUN: mkdir %theaders -// RUN: cp -R %S/Inputs/readability-identifier-naming/. %theaders +// RUN: cp -R %S/Inputs/identifier-naming/. %theaders // C++11 isn't explicitly required, but failing to specify a standard means the // check will run multiple times for different standards. This will cause the @@ -19,7 +19,7 @@ // On DISABLED run, everything should be made 'camelBack'. -// RUN: cp -R %S/Inputs/readability-identifier-naming/. %theaders +// RUN: cp -R %S/Inputs/identifier-naming/. %theaders // RUN: %check_clang_tidy -check-suffixes=DISABLED,SHARED -std=c++11 %s \ // RUN: readability-identifier-naming %t -- \ // RUN: -config='{ InheritParentConfig: false, CheckOptions: [ \ Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp @@ -82,8 +82,8 @@ // RUN: {key: readability-identifier-naming.LocalConstantPointerCase, value: CamelCase}, \ // RUN: {key: readability-identifier-naming.LocalConstantPointerPrefix, value: 'lc_'}, \ // RUN: ]}' -- -fno-delayed-template-parsing -Dbad_macro -std=c++17 -fcoroutines-ts \ -// RUN: -I%S/Inputs/readability-identifier-naming \ -// RUN: -isystem %S/Inputs/readability-identifier-naming/system +// RUN: -I%S/Inputs/identifier-naming \ +// RUN: -isystem %S/Inputs/identifier-naming/system // clang-format off Index: clang-tools-extra/test/clang-tidy/checkers/readability/redundant-preprocessor.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/redundant-preprocessor.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/redundant-preprocessor.cpp @@ -19,7 +19,7 @@ #endif // Negative testing. -#include "readability-redundant-preprocessor.h" +#include "redundant-preprocessor.h" #ifndef BAR void g(); Index: clang-tools-extra/test/clang-tidy/checkers/readability/static-accessed-through-instance.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/static-accessed-through-instance.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/static-accessed-through-instance.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s readability-static-accessed-through-instance %t -- -- -isystem %S/Inputs/readability-static-accessed-through-instance +// RUN: %check_clang_tidy %s readability-static-accessed-through-instance %t -- -- -isystem %S/Inputs/static-accessed-through-instance #include <__clang_cuda_builtin_vars.h> struct C { Index: clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-float16.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s readability-uppercase-literal-suffix %t -- -- -target aarch64-linux-gnu -I %S -#include "readability-uppercase-literal-suffix.h" +#include "uppercase-literal-suffix.h" void float16_normal_literals() { // _Float16 Index: clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-floating-point.cpp @@ -3,7 +3,7 @@ // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -- -target x86_64-pc-linux-gnu -I %S // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -- -target x86_64-pc-linux-gnu -I %S -#include "readability-uppercase-literal-suffix.h" +#include "uppercase-literal-suffix.h" void floating_point_suffix() { static constexpr auto v0 = 1.; // no literal Index: clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-hexadecimal-floating-point.cpp @@ -3,7 +3,7 @@ // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -- -target x86_64-pc-linux-gnu -I %S // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -- -target x86_64-pc-linux-gnu -I %S -#include "readability-uppercase-literal-suffix.h" +#include "uppercase-literal-suffix.h" void floating_point_suffix() { static constexpr auto v0 = 0x0p0; // no literal Index: clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-custom-list.cpp @@ -3,7 +3,7 @@ // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.NewSuffixes, value: 'L;uL'}]}" -- -I %S // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -config="{CheckOptions: [{key: readability-uppercase-literal-suffix.NewSuffixes, value: 'L;uL'}]}" -- -I %S -#include "readability-uppercase-literal-suffix.h" +#include "uppercase-literal-suffix.h" void integer_suffix() { // Unsigned Index: clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer-ms.cpp @@ -3,7 +3,7 @@ // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -- -target x86_64-pc-linux-gnu -I %S -fms-extensions // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -- -target x86_64-pc-linux-gnu -I %S -fms-extensions -#include "readability-uppercase-literal-suffix.h" +#include "uppercase-literal-suffix.h" void integer_suffix() { static constexpr auto v0 = __LINE__; // synthetic Index: clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/uppercase-literal-suffix-integer.cpp @@ -3,7 +3,7 @@ // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -fix -- -I %S // RUN: clang-tidy %t.cpp -checks='-*,readability-uppercase-literal-suffix' -warnings-as-errors='-*,readability-uppercase-literal-suffix' -- -I %S -#include "readability-uppercase-literal-suffix.h" +#include "uppercase-literal-suffix.h" void integer_suffix() { static constexpr auto v0 = __LINE__; // synthetic Index: clang-tools-extra/test/lit.cfg.py =================================================================== --- clang-tools-extra/test/lit.cfg.py +++ clang-tools-extra/test/lit.cfg.py @@ -51,6 +51,10 @@ config.substitutions.append( ('%run_clang_tidy', '%s %s' % (python_exec, run_clang_tidy)) ) +clang_tidy_headers = os.path.join( + config.test_source_root, "clang-tidy", "checkers", "Inputs", "Headers") +config.substitutions.append( + ("%clang_tidy_headers", clang_tidy_headers) ) # Plugins (loadable modules) if config.has_plugins and config.llvm_plugin_ext: