Index: test/clang-tidy/arg-comments.cpp =================================================================== --- test/clang-tidy/arg-comments.cpp +++ test/clang-tidy/arg-comments.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-argument-comment %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-argument-comment %t // FIXME: clang-tidy should provide a -verify mode to make writing these checks // easier and more accurate. Index: test/clang-tidy/check_clang_tidy.py =================================================================== --- /dev/null +++ test/clang-tidy/check_clang_tidy.py @@ -0,0 +1,113 @@ +#!/usr/bin/python +# +#===- check_clang_tidy.py - ClangTidy Test Helper ------------*- python -*--===# +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# + +r""" +ClangTidy Test Helper +===================== + +This script runs clang-tidy in fix mode and verify fixes, messages or both. + +Usage: + check_clang_tidy.py \ + [optional clang-tidy arguments] + +Example: + // RUN: %python %S/check_clang_tidy.py %s llvm-include-order %t -- -isystem $(dirname %s)/Inputs/Headers +""" + +import re +import subprocess +import sys + + +def write_file(file_name, text): + with open(file_name, 'w') as f: + f.write(text) + f.truncate() + +def main(): + if len(sys.argv) < 4: + sys.exit('Not enough arguments.') + + input_file_name = sys.argv[1] + check_name = sys.argv[2] + temp_file_name = sys.argv[3] + '.cpp' + + clang_tidy_extra_args = sys.argv[4:] + if len(clang_tidy_extra_args) == 0: + clang_tidy_extra_args = ['--', '--std=c++11'] + + with open(input_file_name, 'r') as input_file: + input_text = input_file.read() + + has_check_fixes = input_text.find('CHECK-FIXES') >= 0 + has_check_messages = input_text.find('CHECK-MESSAGES') >= 0 + + if not has_check_fixes and not has_check_messages: + sys.exit('Neither CHECK-FIXES nor CHECK-MESSAGES found in the input') + + # Remove the contents of the CHECK lines to avoid CHECKs matching on + # themselves. We need to keep the comments to preserve line numbers while + # avoiding empty lines which could potentially trigger formatting-related + # checks. + cleaned_test = re.sub('// *CHECK-[A-Z-]*:[^\r\n]*', '//', input_text) + + write_file(temp_file_name, cleaned_test) + + original_file_name = temp_file_name + ".orig" + write_file(original_file_name, cleaned_test) + + args = ['clang-tidy', temp_file_name, '-fix', '--checks=-*,' + check_name] + \ + clang_tidy_extra_args + print('Running ' + repr(args) + '...') + clang_tidy_output = \ + subprocess.check_output(args, stderr=subprocess.STDOUT).decode() + + print('------------------------ clang-tidy output -----------------------\n' + + clang_tidy_output + + '\n------------------------------------------------------------------') + + try: + diff_output = subprocess.check_output( + ['diff', '-u', original_file_name, temp_file_name], + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + diff_output = e.output + + print('------------------------------ Fixes -----------------------------\n' + + diff_output.decode() + + '\n------------------------------------------------------------------') + + if has_check_fixes: + try: + subprocess.check_output( + ['FileCheck', '-input-file=' + temp_file_name, input_file_name, + '-check-prefix=CHECK-FIXES', '-strict-whitespace'], + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + print('FileCheck failed:\n' + e.output) + raise + + if has_check_messages: + messages_file = temp_file_name + '.msg' + write_file(messages_file, clang_tidy_output) + try: + subprocess.check_output( + ['FileCheck', '-input-file=' + messages_file, input_file_name, + '-check-prefix=CHECK-MESSAGES', + '-implicit-check-not={{warning|error}}:'], + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + print('FileCheck failed:\n' + e.output) + raise + +if __name__ == '__main__': + main() Index: test/clang-tidy/google-explicit-constructor.cpp =================================================================== --- test/clang-tidy/google-explicit-constructor.cpp +++ test/clang-tidy/google-explicit-constructor.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-explicit-constructor %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-explicit-constructor %t namespace std { typedef decltype(sizeof(int)) size_t; Index: test/clang-tidy/google-explicit-make-pair.cpp =================================================================== --- test/clang-tidy/google-explicit-make-pair.cpp +++ test/clang-tidy/google-explicit-make-pair.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-build-explicit-make-pair %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-build-explicit-make-pair %t namespace std { template Index: test/clang-tidy/google-member-string-references.cpp =================================================================== --- test/clang-tidy/google-member-string-references.cpp +++ test/clang-tidy/google-member-string-references.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-member-string-references %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-runtime-member-string-references %t namespace std { template Index: test/clang-tidy/google-memset-zero-length.cpp =================================================================== --- test/clang-tidy/google-memset-zero-length.cpp +++ test/clang-tidy/google-memset-zero-length.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-memset %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-runtime-memset %t void *memset(void *, int, __SIZE_TYPE__); Index: test/clang-tidy/google-overloaded-unary-and.cpp =================================================================== --- test/clang-tidy/google-overloaded-unary-and.cpp +++ test/clang-tidy/google-overloaded-unary-and.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-operator %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-runtime-operator %t struct Foo { void *operator&(); Index: test/clang-tidy/google-readability-casting.c =================================================================== --- test/clang-tidy/google-readability-casting.c +++ test/clang-tidy/google-readability-casting.c @@ -1,4 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-casting %t -- -x c +// RUN: %python %S/check_clang_tidy.py %s google-readability-casting %t -- -x c // The testing script always adds .cpp extension to the input file name, so we // need to run clang-tidy directly in order to verify handling of .c files: // RUN: clang-tidy --checks=-*,google-readability-casting %s -- -x c++ | FileCheck %s -check-prefix=CHECK-MESSAGES -implicit-check-not='{{warning|error}}:' Index: test/clang-tidy/google-readability-casting.cpp =================================================================== --- test/clang-tidy/google-readability-casting.cpp +++ test/clang-tidy/google-readability-casting.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-casting %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-readability-casting %t bool g() { return false; } Index: test/clang-tidy/google-readability-namespace-comments.cpp =================================================================== --- test/clang-tidy/google-readability-namespace-comments.cpp +++ test/clang-tidy/google-readability-namespace-comments.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-namespace-comments %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-readability-namespace-comments %t namespace n1 { namespace n2 { Index: test/clang-tidy/google-readability-todo.cpp =================================================================== --- test/clang-tidy/google-readability-todo.cpp +++ test/clang-tidy/google-readability-todo.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-todo %t -config="{User: 'some user'}" -- -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-readability-todo %t -config="{User: 'some user'}" -- // TODOfix this1 // CHECK-MESSAGES: [[@LINE-1]]:1: warning: missing username/bug in TODO Index: test/clang-tidy/google-runtime-int.cpp =================================================================== --- test/clang-tidy/google-runtime-int.cpp +++ test/clang-tidy/google-runtime-int.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-int %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s google-runtime-int %t long a(); // CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'long' with 'int{{..}}' Index: test/clang-tidy/llvm-include-order.cpp =================================================================== --- test/clang-tidy/llvm-include-order.cpp +++ test/clang-tidy/llvm-include-order.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s llvm-include-order %t -- -isystem %S/Inputs/Headers -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s llvm-include-order %t -- -isystem %S/Inputs/Headers // FIXME: Investigating. // XFAIL: win32 Index: test/clang-tidy/llvm-twine-local.cpp =================================================================== --- test/clang-tidy/llvm-twine-local.cpp +++ test/clang-tidy/llvm-twine-local.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s llvm-twine-local %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s llvm-twine-local %t namespace llvm { class Twine { Index: test/clang-tidy/misc-assert-side-effect.cpp =================================================================== --- test/clang-tidy/misc-assert-side-effect.cpp +++ test/clang-tidy/misc-assert-side-effect.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-assert-side-effect %t -config="{CheckOptions: [{key: misc-assert-side-effect.CheckFunctionCalls, value: 1}, {key: misc-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert'}]}" -- -fexceptions -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-assert-side-effect %t -config="{CheckOptions: [{key: misc-assert-side-effect.CheckFunctionCalls, value: 1}, {key: misc-assert-side-effect.AssertMacros, value: 'assert,assert2,my_assert'}]}" -- -fexceptions //===--- assert definition block ------------------------------------------===// int abort() { return 0; } Index: test/clang-tidy/misc-assign-operator-signature.cpp =================================================================== --- test/clang-tidy/misc-assign-operator-signature.cpp +++ test/clang-tidy/misc-assign-operator-signature.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-assign-operator-signature %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-assign-operator-signature %t struct Good { Good& operator=(const Good&); Index: test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp =================================================================== --- test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp +++ test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-bool-pointer-implicit-conversion %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-bool-pointer-implicit-conversion %t bool *SomeFunction(); void SomeOtherFunction(bool*); Index: test/clang-tidy/misc-inaccurate-erase.cpp =================================================================== --- test/clang-tidy/misc-inaccurate-erase.cpp +++ test/clang-tidy/misc-inaccurate-erase.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-inaccurate-erase %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-inaccurate-erase %t namespace std { template struct vec_iterator { Index: test/clang-tidy/misc-inefficient-algorithm.cpp =================================================================== --- test/clang-tidy/misc-inefficient-algorithm.cpp +++ test/clang-tidy/misc-inefficient-algorithm.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-inefficient-algorithm %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-inefficient-algorithm %t namespace std { template struct less { Index: test/clang-tidy/misc-macro-parentheses.cpp =================================================================== --- test/clang-tidy/misc-macro-parentheses.cpp +++ test/clang-tidy/misc-macro-parentheses.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-macro-parentheses %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-macro-parentheses %t #define BAD1 -1 // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: macro replacement list should be enclosed in parentheses [misc-macro-parentheses] Index: test/clang-tidy/misc-noexcept-move-constructor.cpp =================================================================== --- test/clang-tidy/misc-noexcept-move-constructor.cpp +++ test/clang-tidy/misc-noexcept-move-constructor.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-noexcept-move-constructor %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-noexcept-move-constructor %t class A { A(A &&); Index: test/clang-tidy/misc-repeated-side-effects-in-macro.c =================================================================== --- test/clang-tidy/misc-repeated-side-effects-in-macro.c +++ test/clang-tidy/misc-repeated-side-effects-in-macro.c @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-macro-repeated-side-effects %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-macro-repeated-side-effects %t #define badA(x,y) ((x)+((x)+(y))+(y)) void bad(int ret, int a, int b) { Index: test/clang-tidy/misc-static-assert.cpp =================================================================== --- test/clang-tidy/misc-static-assert.cpp +++ test/clang-tidy/misc-static-assert.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-static-assert %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-static-assert %t void abort() {} #ifdef NDEBUG Index: test/clang-tidy/misc-swapped-arguments.cpp =================================================================== --- test/clang-tidy/misc-swapped-arguments.cpp +++ test/clang-tidy/misc-swapped-arguments.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-swapped-arguments %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-swapped-arguments %t void F(int, double); Index: test/clang-tidy/misc-undelegated-constructor.cpp =================================================================== --- test/clang-tidy/misc-undelegated-constructor.cpp +++ test/clang-tidy/misc-undelegated-constructor.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-undelegated-constructor %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-undelegated-constructor %t struct Ctor; Ctor foo(); Index: test/clang-tidy/misc-uniqueptr-reset-release.cpp =================================================================== --- test/clang-tidy/misc-uniqueptr-reset-release.cpp +++ test/clang-tidy/misc-uniqueptr-reset-release.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-uniqueptr-reset-release %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-uniqueptr-reset-release %t namespace std { Index: test/clang-tidy/misc-unused-alias-decls.cpp =================================================================== --- test/clang-tidy/misc-unused-alias-decls.cpp +++ test/clang-tidy/misc-unused-alias-decls.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-unused-alias-decls %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-unused-alias-decls %t namespace my_namespace { class C {}; Index: test/clang-tidy/misc-unused-parameters.c =================================================================== --- test/clang-tidy/misc-unused-parameters.c +++ test/clang-tidy/misc-unused-parameters.c @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-unused-parameters %t -- -xc -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-unused-parameters %t -- -xc // Basic removal // ============= Index: test/clang-tidy/misc-unused-parameters.cpp =================================================================== --- test/clang-tidy/misc-unused-parameters.cpp +++ test/clang-tidy/misc-unused-parameters.cpp @@ -1,8 +1,7 @@ // RUN: echo "static void staticFunctionHeader(int i) {}" > %T/header.h // RUN: echo "static void staticFunctionHeader(int /*i*/) {}" > %T/header-fixed.h -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-unused-parameters %t -header-filter='.*' -- -fno-delayed-template-parsing +// RUN: %python %S/check_clang_tidy.py %s misc-unused-parameters %t -header-filter='.*' -- -fno-delayed-template-parsing // RUN: diff %T/header.h %T/header-fixed.h -// REQUIRES: shell #include "header.h" // CHECK-MESSAGES: header.h:1:38: warning Index: test/clang-tidy/misc-unused-raii.cpp =================================================================== --- test/clang-tidy/misc-unused-raii.cpp +++ test/clang-tidy/misc-unused-raii.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-unused-raii %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-unused-raii %t struct Foo { Foo(); Index: test/clang-tidy/misc-use-override-cxx98.cpp =================================================================== --- test/clang-tidy/misc-use-override-cxx98.cpp +++ test/clang-tidy/misc-use-override-cxx98.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-use-override %t -- -std=c++98 -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-use-override %t -- -std=c++98 struct Base { virtual ~Base() {} Index: test/clang-tidy/misc-use-override.cpp =================================================================== --- test/clang-tidy/misc-use-override.cpp +++ test/clang-tidy/misc-use-override.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-use-override %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s misc-use-override %t #define ABSTRACT = 0 Index: test/clang-tidy/modernize-loop-convert-basic.cpp =================================================================== --- test/clang-tidy/modernize-loop-convert-basic.cpp +++ test/clang-tidy/modernize-loop-convert-basic.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert #include "structures.h" Index: test/clang-tidy/modernize-loop-convert-extra.cpp =================================================================== --- test/clang-tidy/modernize-loop-convert-extra.cpp +++ test/clang-tidy/modernize-loop-convert-extra.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert #include "structures.h" Index: test/clang-tidy/modernize-loop-convert-negative.cpp =================================================================== --- test/clang-tidy/modernize-loop-convert-negative.cpp +++ test/clang-tidy/modernize-loop-convert-negative.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert #include "structures.h" Index: test/clang-tidy/modernize-pass-by-value.cpp =================================================================== --- test/clang-tidy/modernize-pass-by-value.cpp +++ test/clang-tidy/modernize-pass-by-value.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s modernize-pass-by-value %t -- -std=c++11 -fno-delayed-template-parsing -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s modernize-pass-by-value %t -- -std=c++11 -fno-delayed-template-parsing // CHECK-FIXES: #include Index: test/clang-tidy/modernize-use-nullptr-basic.cpp =================================================================== --- test/clang-tidy/modernize-use-nullptr-basic.cpp +++ test/clang-tidy/modernize-use-nullptr-basic.cpp @@ -1,6 +1,5 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s modernize-use-nullptr %t -- \ +// RUN: %python %S/check_clang_tidy.py %s modernize-use-nullptr %t -- \ // RUN: -std=c++98 -Wno-non-literal-null-conversion -// REQUIRES: shell const unsigned int g_null = 0; #define NULL 0 Index: test/clang-tidy/modernize-use-nullptr.cpp =================================================================== --- test/clang-tidy/modernize-use-nullptr.cpp +++ test/clang-tidy/modernize-use-nullptr.cpp @@ -1,7 +1,6 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s modernize-use-nullptr %t \ +// RUN: %python %S/check_clang_tidy.py %s modernize-use-nullptr %t \ // RUN: -config="{CheckOptions: [{key: modernize-use-nullptr.NullMacros, value: 'MY_NULL,NULL'}]}" \ // RUN: -- -std=c++11 -// REQUIRES: shell #define NULL 0 Index: test/clang-tidy/readability-braces-around-statements-few-lines.cpp =================================================================== --- test/clang-tidy/readability-braces-around-statements-few-lines.cpp +++ test/clang-tidy/readability-braces-around-statements-few-lines.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 4}]}" -- -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 4}]}" -- void do_something(const char *) {} Index: test/clang-tidy/readability-braces-around-statements-same-line.cpp =================================================================== --- test/clang-tidy/readability-braces-around-statements-same-line.cpp +++ test/clang-tidy/readability-braces-around-statements-same-line.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 1}]}" -- -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 1}]}" -- void do_something(const char *) {} Index: test/clang-tidy/readability-braces-around-statements-single-line.cpp =================================================================== --- test/clang-tidy/readability-braces-around-statements-single-line.cpp +++ test/clang-tidy/readability-braces-around-statements-single-line.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 2}]}" -- -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 2}]}" -- void do_something(const char *) {} Index: test/clang-tidy/readability-braces-around-statements.cpp =================================================================== --- test/clang-tidy/readability-braces-around-statements.cpp +++ test/clang-tidy/readability-braces-around-statements.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t void do_something(const char *) {} Index: test/clang-tidy/readability-container-size-empty.cpp =================================================================== --- test/clang-tidy/readability-container-size-empty.cpp +++ test/clang-tidy/readability-container-size-empty.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-container-size-empty %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-container-size-empty %t namespace std { template struct vector { Index: test/clang-tidy/readability-else-after-return.cpp =================================================================== --- test/clang-tidy/readability-else-after-return.cpp +++ test/clang-tidy/readability-else-after-return.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-else-after-return %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-else-after-return %t void f(int a) { if (a > 0) Index: test/clang-tidy/readability-function-size.cpp =================================================================== --- test/clang-tidy/readability-function-size.cpp +++ test/clang-tidy/readability-function-size.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-function-size %t -config='{CheckOptions: [{key: readability-function-size.LineThreshold, value: 0}, {key: readability-function-size.StatementThreshold, value: 0}, {key: readability-function-size.BranchThreshold, value: 0}]}' -- -std=c++11 -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-function-size %t -config='{CheckOptions: [{key: readability-function-size.LineThreshold, value: 0}, {key: readability-function-size.StatementThreshold, value: 0}, {key: readability-function-size.BranchThreshold, value: 0}]}' -- -std=c++11 void foo1() { } Index: test/clang-tidy/readability-identifier-naming.cpp =================================================================== --- test/clang-tidy/readability-identifier-naming.cpp +++ test/clang-tidy/readability-identifier-naming.cpp @@ -1,4 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-identifier-naming %t \ +// RUN: %python %S/check_clang_tidy.py %s readability-identifier-naming %t \ // RUN: -config='{CheckOptions: [ \ // RUN: {key: readability-identifier-naming.AbstractClassCase, value: CamelCase}, \ // RUN: {key: readability-identifier-naming.AbstractClassPrefix, value: 'A'}, \ @@ -63,7 +63,6 @@ // RUN: {key: readability-identifier-naming.VirtualMethodPrefix, value: 'v_'}, \ // RUN: {key: readability-identifier-naming.IgnoreFailedSplit, value: 0} \ // RUN: ]}' -- -std=c++11 -fno-delayed-template-parsing -// REQUIRES: shell // FIXME: There should be more test cases for checking that references to class // FIXME: name, declaration contexts, forward declarations, etc, are correctly Index: test/clang-tidy/readability-named-parameter.cpp =================================================================== --- test/clang-tidy/readability-named-parameter.cpp +++ test/clang-tidy/readability-named-parameter.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-named-parameter %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-named-parameter %t void Method(char *) { /* */ } // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: all parameters should be named in a function Index: test/clang-tidy/readability-redundant-smartptr-get.cpp =================================================================== --- test/clang-tidy/readability-redundant-smartptr-get.cpp +++ test/clang-tidy/readability-redundant-smartptr-get.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-redundant-smartptr-get %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-redundant-smartptr-get %t #define NULL __null Index: test/clang-tidy/readability-redundant-string-cstr.cpp =================================================================== --- test/clang-tidy/readability-redundant-string-cstr.cpp +++ test/clang-tidy/readability-redundant-string-cstr.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-redundant-string-cstr %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-redundant-string-cstr %t namespace std { template Index: test/clang-tidy/readability-shrink-to-fit.cpp =================================================================== --- test/clang-tidy/readability-shrink-to-fit.cpp +++ test/clang-tidy/readability-shrink-to-fit.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-shrink-to-fit %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-shrink-to-fit %t namespace std { template struct vector { void swap(vector &other); }; Index: test/clang-tidy/readability-simplify-bool-expr-chained-conditional-assignment.cpp =================================================================== --- test/clang-tidy/readability-simplify-bool-expr-chained-conditional-assignment.cpp +++ test/clang-tidy/readability-simplify-bool-expr-chained-conditional-assignment.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-simplify-boolean-expr %t -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalAssignment", value: 1}]}" -- -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-simplify-boolean-expr %t -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalAssignment", value: 1}]}" -- void chained_conditional_compound_assignment(int i) { bool b; Index: test/clang-tidy/readability-simplify-bool-expr-chained-conditional-return.cpp =================================================================== --- test/clang-tidy/readability-simplify-bool-expr-chained-conditional-return.cpp +++ test/clang-tidy/readability-simplify-bool-expr-chained-conditional-return.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-simplify-boolean-expr %t -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalReturn", value: 1}]}" -- -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-simplify-boolean-expr %t -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalReturn", value: 1}]}" -- bool chained_conditional_compound_return(int i) { if (i < 0) { Index: test/clang-tidy/readability-simplify-bool-expr.cpp =================================================================== --- test/clang-tidy/readability-simplify-bool-expr.cpp +++ test/clang-tidy/readability-simplify-bool-expr.cpp @@ -1,5 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-simplify-boolean-expr %t -// REQUIRES: shell +// RUN: %python %S/check_clang_tidy.py %s readability-simplify-boolean-expr %t bool a1 = false;