Add %check_clang_tidy and %clang_tidy_diff.
With this, site specific lit configs can inject parameters into the test scripts if they need site specific parameters. Next up: enable check_clang_tidy to take a resource dir to enable non-standard locations for builtin includes. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@251010 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
10c3416e16
Коммит
82aa9cf440
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cert-err52-cpp %t -- -std=c++11
|
||||
// RUN: %check_clang_tidy %s cert-err52-cpp %t -- -std=c++11
|
||||
|
||||
typedef void *jmp_buf;
|
||||
extern int __setjmpimpl(jmp_buf);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cert-dcl50-cpp %t
|
||||
// RUN: %check_clang_tidy %s cert-dcl50-cpp %t
|
||||
|
||||
// Variadic function definitions are diagnosed.
|
||||
void f1(int, ...) {}
|
||||
|
|
|
@ -20,7 +20,7 @@ Usage:
|
|||
[optional clang-tidy arguments]
|
||||
|
||||
Example:
|
||||
// RUN: %python %S/check_clang_tidy.py %s llvm-include-order %t -- -isystem $(dirname %s)/Inputs/Headers
|
||||
// RUN: %check_clang_tidy %s llvm-include-order %t -- -isystem $(dirname %s)/Inputs/Headers
|
||||
"""
|
||||
|
||||
import re
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
|
||||
// RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 | FileCheck -check-prefix=CHECK-SANITY %s
|
||||
// RUN: not diff -U0 %s %t.cpp | %python %S/../../clang-tidy/tool/clang-tidy-diff.py -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s
|
||||
// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s
|
||||
struct A {
|
||||
virtual void f() {}
|
||||
virtual void g() {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-bounds-pointer-arithmetic %t
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-bounds-pointer-arithmetic %t
|
||||
|
||||
enum E {
|
||||
ENUM_LITERAL = 1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-const-cast %t
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-const-cast %t
|
||||
|
||||
const int *i;
|
||||
int *j;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-reinterpret-cast %t
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-reinterpret-cast %t
|
||||
|
||||
int i = 0;
|
||||
void *j;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-static-cast-downcast %t
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-static-cast-downcast %t
|
||||
|
||||
class Base {
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-union-access %t
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-union-access %t
|
||||
|
||||
union U {
|
||||
bool union_member1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s cppcoreguidelines-pro-type-vararg %t
|
||||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-vararg %t
|
||||
|
||||
void f(int i);
|
||||
void f_vararg(int i, ...);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-build-explicit-make-pair %t
|
||||
// RUN: %check_clang_tidy %s google-build-explicit-make-pair %t
|
||||
|
||||
namespace std {
|
||||
template <class T1, class T2>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-explicit-constructor %t
|
||||
// RUN: %check_clang_tidy %s google-explicit-constructor %t
|
||||
|
||||
namespace std {
|
||||
typedef decltype(sizeof(int)) size_t;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-runtime-operator %t
|
||||
// RUN: %check_clang_tidy %s google-runtime-operator %t
|
||||
|
||||
struct Foo {
|
||||
void *operator&();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-readability-casting %t -- -x c
|
||||
// RUN: %check_clang_tidy %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}}:'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-readability-casting %t
|
||||
// RUN: %check_clang_tidy %s google-readability-casting %t
|
||||
|
||||
bool g() { return false; }
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-readability-namespace-comments %t
|
||||
// RUN: %check_clang_tidy %s google-readability-namespace-comments %t
|
||||
|
||||
namespace n1 {
|
||||
namespace n2 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-readability-todo %t -config="{User: 'some user'}" --
|
||||
// RUN: %check_clang_tidy %s google-readability-todo %t -config="{User: 'some user'}" --
|
||||
|
||||
// TODOfix this1
|
||||
// CHECK-MESSAGES: [[@LINE-1]]:1: warning: missing username/bug in TODO
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-runtime-int %t \
|
||||
// RUN: %check_clang_tidy %s google-runtime-int %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: google-runtime-int.UnsignedTypePrefix, value: "std::uint"}, \
|
||||
// RUN: {key: google-runtime-int.SignedTypePrefix, value: "std::int"}, \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-runtime-int %t
|
||||
// RUN: %check_clang_tidy %s google-runtime-int %t
|
||||
|
||||
long a();
|
||||
// CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'long' with 'int{{..}}'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-runtime-member-string-references %t
|
||||
// RUN: %check_clang_tidy %s google-runtime-member-string-references %t
|
||||
|
||||
namespace std {
|
||||
template<typename T>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s google-runtime-memset %t
|
||||
// RUN: %check_clang_tidy %s google-runtime-memset %t
|
||||
|
||||
void *memset(void *, int, __SIZE_TYPE__);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s llvm-include-order %t -- -isystem %S/Inputs/Headers
|
||||
// RUN: %check_clang_tidy %s llvm-include-order %t -- -isystem %S/Inputs/Headers
|
||||
|
||||
// CHECK-MESSAGES: [[@LINE+2]]:1: warning: #includes are not sorted properly
|
||||
#include "j.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s llvm-twine-local %t
|
||||
// RUN: %check_clang_tidy %s llvm-twine-local %t
|
||||
|
||||
namespace llvm {
|
||||
class Twine {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-argument-comment %t
|
||||
// RUN: %check_clang_tidy %s misc-argument-comment %t
|
||||
|
||||
// FIXME: clang-tidy should provide a -verify mode to make writing these checks
|
||||
// easier and more accurate.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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,convoluted_assert'}]}" -- -fexceptions
|
||||
// RUN: %check_clang_tidy %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,convoluted_assert'}]}" -- -fexceptions
|
||||
|
||||
//===--- assert definition block ------------------------------------------===//
|
||||
int abort() { return 0; }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-assign-operator-signature %t
|
||||
// RUN: %check_clang_tidy %s misc-assign-operator-signature %t
|
||||
|
||||
struct Good {
|
||||
Good& operator=(const Good&);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-bool-pointer-implicit-conversion %t
|
||||
// RUN: %check_clang_tidy %s misc-bool-pointer-implicit-conversion %t
|
||||
|
||||
bool *SomeFunction();
|
||||
void SomeOtherFunction(bool*);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-inaccurate-erase %t
|
||||
// RUN: %check_clang_tidy %s misc-inaccurate-erase %t
|
||||
|
||||
namespace std {
|
||||
template <typename T> struct vec_iterator {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-inefficient-algorithm %t
|
||||
// RUN: %check_clang_tidy %s misc-inefficient-algorithm %t
|
||||
|
||||
namespace std {
|
||||
template <typename T> struct less {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-macro-parentheses %t
|
||||
// RUN: %check_clang_tidy %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]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-move-constructor-init %t -- -std=c++11 -isystem %S/Inputs/Headers
|
||||
// RUN: %check_clang_tidy %s misc-move-constructor-init %t -- -std=c++11 -isystem %S/Inputs/Headers
|
||||
|
||||
#include <s.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-new-delete-overloads %t -- -std=c++14 -fsized-deallocation
|
||||
// RUN: %check_clang_tidy %s misc-new-delete-overloads %t -- -std=c++14 -fsized-deallocation
|
||||
|
||||
typedef decltype(sizeof(int)) size_t;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-new-delete-overloads %t -- -std=c++14
|
||||
// RUN: %check_clang_tidy %s misc-new-delete-overloads %t -- -std=c++14
|
||||
|
||||
typedef decltype(sizeof(int)) size_t;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-noexcept-move-constructor %t
|
||||
// RUN: %check_clang_tidy %s misc-noexcept-move-constructor %t
|
||||
|
||||
class A {
|
||||
A(A &&);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-non-copyable-objects %t
|
||||
// RUN: %check_clang_tidy %s misc-non-copyable-objects %t
|
||||
|
||||
typedef struct FILE {} FILE;
|
||||
typedef struct pthread_cond_t {} pthread_cond_t;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-non-copyable-objects %t
|
||||
// RUN: %check_clang_tidy %s misc-non-copyable-objects %t
|
||||
|
||||
namespace std {
|
||||
typedef struct FILE {} FILE;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-macro-repeated-side-effects %t
|
||||
// RUN: %check_clang_tidy %s misc-macro-repeated-side-effects %t
|
||||
|
||||
#define badA(x,y) ((x)+((x)+(y))+(y))
|
||||
void bad(int ret, int a, int b) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-sizeof-container %t -- -std=c++11 -target x86_64-unknown-unknown
|
||||
// RUN: %check_clang_tidy %s misc-sizeof-container %t -- -std=c++11 -target x86_64-unknown-unknown
|
||||
|
||||
namespace std {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-static-assert %t -- -std=c11
|
||||
// RUN: %check_clang_tidy %s misc-static-assert %t -- -std=c11
|
||||
// RUN: clang-tidy %s -checks=-*,misc-static-assert -- -std=c99 | count 0
|
||||
|
||||
void abort() {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-static-assert %t
|
||||
// RUN: %check_clang_tidy %s misc-static-assert %t
|
||||
|
||||
void abort() {}
|
||||
#ifdef NDEBUG
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-swapped-arguments %t
|
||||
// RUN: %check_clang_tidy %s misc-swapped-arguments %t
|
||||
|
||||
void F(int, double);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-throw-by-value-catch-by-reference %t -- -std=c++11 -fcxx-exceptions
|
||||
// RUN: %check_clang_tidy %s misc-throw-by-value-catch-by-reference %t -- -std=c++11 -fcxx-exceptions
|
||||
|
||||
|
||||
class logic_error {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-undelegated-constructor %t
|
||||
// RUN: %check_clang_tidy %s misc-undelegated-constructor %t
|
||||
|
||||
struct Ctor;
|
||||
Ctor foo();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-uniqueptr-reset-release %t
|
||||
// RUN: %check_clang_tidy %s misc-uniqueptr-reset-release %t
|
||||
|
||||
namespace std {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-unused-alias-decls %t
|
||||
// RUN: %check_clang_tidy %s misc-unused-alias-decls %t
|
||||
|
||||
namespace my_namespace {
|
||||
class C {};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-unused-parameters %t -- -xc
|
||||
// RUN: %check_clang_tidy %s misc-unused-parameters %t -- -xc
|
||||
|
||||
// Basic removal
|
||||
// =============
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: echo "static void staticFunctionHeader(int i) {}" > %T/header.h
|
||||
// RUN: echo "static void staticFunctionHeader(int /*i*/) {}" > %T/header-fixed.h
|
||||
// RUN: %python %S/check_clang_tidy.py %s misc-unused-parameters %t -header-filter='.*' -- -std=c++11 -fno-delayed-template-parsing
|
||||
// RUN: %check_clang_tidy %s misc-unused-parameters %t -header-filter='.*' -- -std=c++11 -fno-delayed-template-parsing
|
||||
// RUN: diff %T/header.h %T/header-fixed.h
|
||||
|
||||
#include "header.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s misc-unused-raii %t
|
||||
// RUN: %check_clang_tidy %s misc-unused-raii %t
|
||||
|
||||
struct Foo {
|
||||
Foo();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
|
||||
#include "structures.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t \
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'camelBack'}]}" \
|
||||
// RUN: -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
|
||||
#include "structures.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t \
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'lower_case'}]}" \
|
||||
// RUN: -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
|
||||
#include "structures.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-loop-convert %t \
|
||||
// RUN: %check_clang_tidy %s modernize-loop-convert %t \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-loop-convert.NamingStyle, value: 'UPPER_CASE'}]}" \
|
||||
// RUN: -- -std=c++11 -I %S/Inputs/modernize-loop-convert
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-make-unique %t
|
||||
// RUN: %check_clang_tidy %s modernize-make-unique %t
|
||||
|
||||
namespace std {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-pass-by-value %t -- -std=c++11 -fno-delayed-template-parsing
|
||||
// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -std=c++11 -fno-delayed-template-parsing
|
||||
|
||||
// CHECK-FIXES: #include <utility>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-replace-auto-ptr %t -- \
|
||||
// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- \
|
||||
// RUN: -std=c++11 -I %S/Inputs/modernize-replace-auto-ptr
|
||||
|
||||
// CHECK-FIXES: #include <utility>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-shrink-to-fit %t
|
||||
// RUN: %check_clang_tidy %s modernize-shrink-to-fit %t
|
||||
|
||||
namespace std {
|
||||
template <typename T> struct vector { void swap(vector &other); };
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-auto %t -- \
|
||||
// RUN: %check_clang_tidy %s modernize-use-auto %t -- \
|
||||
// RUN: -std=c++11 -I %S/Inputs/modernize-use-auto
|
||||
|
||||
#include "containers.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-auto %t
|
||||
// RUN: %check_clang_tidy %s modernize-use-auto %t
|
||||
|
||||
class MyType {};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-default %t -- -std=c++11 -fno-delayed-template-parsing
|
||||
// RUN: %check_clang_tidy %s modernize-use-default %t -- -std=c++11 -fno-delayed-template-parsing
|
||||
|
||||
class A {
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-nullptr %t -- \
|
||||
// RUN: %check_clang_tidy %s modernize-use-nullptr %t -- \
|
||||
// RUN: -std=c++98 -Wno-non-literal-null-conversion
|
||||
//
|
||||
// Some parts of the test (e.g. assignment of `const int` to `int *`) fail in
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-nullptr %t \
|
||||
// RUN: %check_clang_tidy %s modernize-use-nullptr %t \
|
||||
// RUN: -config="{CheckOptions: [{key: modernize-use-nullptr.NullMacros, value: 'MY_NULL,NULL'}]}" \
|
||||
// RUN: -- -std=c++11
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-override %t -- -std=c++98
|
||||
// RUN: %check_clang_tidy %s modernize-use-override %t -- -std=c++98
|
||||
|
||||
struct Base {
|
||||
virtual ~Base() {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s modernize-use-override %t
|
||||
// RUN: %check_clang_tidy %s modernize-use-override %t
|
||||
|
||||
#define ABSTRACT = 0
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 4}]}" --
|
||||
// RUN: %check_clang_tidy %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 4}]}" --
|
||||
|
||||
void do_something(const char *) {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 1}]}" --
|
||||
// RUN: %check_clang_tidy %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 1}]}" --
|
||||
|
||||
void do_something(const char *) {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 2}]}" --
|
||||
// RUN: %check_clang_tidy %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 2}]}" --
|
||||
|
||||
void do_something(const char *) {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-braces-around-statements %t
|
||||
// RUN: %check_clang_tidy %s readability-braces-around-statements %t
|
||||
|
||||
void do_something(const char *) {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-container-size-empty %t
|
||||
// RUN: %check_clang_tidy %s readability-container-size-empty %t
|
||||
|
||||
namespace std {
|
||||
template <typename T> struct vector {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-else-after-return %t
|
||||
// RUN: %check_clang_tidy %s readability-else-after-return %t
|
||||
|
||||
void f(int a) {
|
||||
if (a > 0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
// RUN: %check_clang_tidy %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() {
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-identifier-naming %t \
|
||||
// RUN: %check_clang_tidy %s readability-identifier-naming %t \
|
||||
// RUN: -config='{CheckOptions: [ \
|
||||
// RUN: {key: readability-identifier-naming.AbstractClassCase, value: CamelCase}, \
|
||||
// RUN: {key: readability-identifier-naming.AbstractClassPrefix, value: 'A'}, \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-inconsistent-declaration-parameter-name %t -- -std=c++11 -fno-delayed-template-parsing
|
||||
// RUN: %check_clang_tidy %s readability-inconsistent-declaration-parameter-name %t -- -std=c++11 -fno-delayed-template-parsing
|
||||
|
||||
void consistentFunction(int a, int b, int c);
|
||||
void consistentFunction(int a, int b, int c);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-named-parameter %t
|
||||
// RUN: %check_clang_tidy %s readability-named-parameter %t
|
||||
|
||||
void Method(char *) { /* */ }
|
||||
// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: all parameters should be named in a function
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-redundant-smartptr-get %t
|
||||
// RUN: %check_clang_tidy %s readability-redundant-smartptr-get %t
|
||||
|
||||
#define NULL __null
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-redundant-string-cstr %t
|
||||
// RUN: %check_clang_tidy %s readability-redundant-string-cstr %t
|
||||
|
||||
namespace std {
|
||||
template <typename T>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-simplify-boolean-expr %t -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalAssignment", value: 1}]}" --
|
||||
// RUN: %check_clang_tidy %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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-simplify-boolean-expr %t -config="{CheckOptions: [{key: "readability-simplify-boolean-expr.ChainedConditionalReturn", value: 1}]}" --
|
||||
// RUN: %check_clang_tidy %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) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-simplify-boolean-expr %t
|
||||
// RUN: %check_clang_tidy %s readability-simplify-boolean-expr %t
|
||||
|
||||
bool a1 = false;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %python %S/check_clang_tidy.py %s readability-uniqueptr-delete-release %t
|
||||
// RUN: %check_clang_tidy %s readability-uniqueptr-delete-release %t
|
||||
|
||||
namespace std {
|
||||
template <typename T>
|
||||
|
|
11
test/lit.cfg
11
test/lit.cfg
|
@ -188,4 +188,13 @@ if not platform.system() in ['Windows'] or not execute_external:
|
|||
if platform.system() not in ['Windows']:
|
||||
config.available_features.add('ansi-escape-sequences')
|
||||
|
||||
config.substitutions.append( ('%python', config.python_executable) )
|
||||
check_clang_tidy = os.path.join(
|
||||
config.test_source_root, "clang-tidy", "check_clang_tidy.py")
|
||||
config.substitutions.append(
|
||||
('%check_clang_tidy',
|
||||
'%s %s' % (config.python_executable, check_clang_tidy)) )
|
||||
clang_tidy_diff = os.path.join(
|
||||
config.test_source_root, "..", "clang-tidy", "tool", "clang-tidy-diff.py")
|
||||
config.substitutions.append(
|
||||
('%clang_tidy_diff',
|
||||
'%s %s' % (config.python_executable, clang_tidy_diff)) )
|
||||
|
|
Загрузка…
Ссылка в новой задаче