Skip to content

Commit 8bad406

Browse files
committed
Make tests more readable
1 parent ce0e935 commit 8bad406

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

clang-tools-extra/test/clang-tidy/checkers/modernize/use-concise-preprocessor-directives.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
// RUN: %check_clang_tidy -std=c++98 -check-suffixes=ALL,CXX %s modernize-use-concise-preprocessor-directives %t
2-
// RUN: %check_clang_tidy -std=c++11 -check-suffixes=ALL,CXX %s modernize-use-concise-preprocessor-directives %t
3-
// RUN: %check_clang_tidy -std=c++14 -check-suffixes=ALL,CXX %s modernize-use-concise-preprocessor-directives %t
4-
// RUN: %check_clang_tidy -std=c++17 -check-suffixes=ALL,CXX %s modernize-use-concise-preprocessor-directives %t
5-
// RUN: %check_clang_tidy -std=c++20 -check-suffixes=ALL,CXX %s modernize-use-concise-preprocessor-directives %t
6-
// RUN: %check_clang_tidy -std=c++23-or-later -check-suffixes=ALL,23,CXX,CXX23 %s modernize-use-concise-preprocessor-directives %t
7-
8-
// RUN: %check_clang_tidy -std=c99 -check-suffix=ALL %s modernize-use-concise-preprocessor-directives %t -- -- -x c
9-
// RUN: %check_clang_tidy -std=c11 -check-suffix=ALL %s modernize-use-concise-preprocessor-directives %t -- -- -x c
10-
// RUN: %check_clang_tidy -std=c23-or-later -check-suffix=ALL,23 %s modernize-use-concise-preprocessor-directives %t -- -- -x c
11-
12-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
13-
// CHECK-FIXES-ALL: #ifdef FOO
1+
// RUN: %check_clang_tidy -std=c++98 -check-suffixes=,CXX %s modernize-use-concise-preprocessor-directives %t
2+
// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX %s modernize-use-concise-preprocessor-directives %t
3+
// RUN: %check_clang_tidy -std=c++14 -check-suffixes=,CXX %s modernize-use-concise-preprocessor-directives %t
4+
// RUN: %check_clang_tidy -std=c++17 -check-suffixes=,CXX %s modernize-use-concise-preprocessor-directives %t
5+
// RUN: %check_clang_tidy -std=c++20 -check-suffixes=,CXX %s modernize-use-concise-preprocessor-directives %t
6+
// RUN: %check_clang_tidy -std=c++23-or-later -check-suffixes=,23,CXX,CXX23 %s modernize-use-concise-preprocessor-directives %t
7+
8+
// RUN: %check_clang_tidy -std=c99 %s modernize-use-concise-preprocessor-directives %t -- -- -x c
9+
// RUN: %check_clang_tidy -std=c11 %s modernize-use-concise-preprocessor-directives %t -- -- -x c
10+
// RUN: %check_clang_tidy -std=c23-or-later -check-suffixes=,23 %s modernize-use-concise-preprocessor-directives %t -- -- -x c
11+
12+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
13+
// CHECK-FIXES: #ifdef FOO
1414
#if defined(FOO)
1515
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifdef [modernize-use-concise-preprocessor-directives]
1616
// CHECK-FIXES-23: #elifdef BAR
1717
#elif defined(BAR)
1818
#endif
1919

20-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
21-
// CHECK-FIXES-ALL: #ifdef FOO
20+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
21+
// CHECK-FIXES: #ifdef FOO
2222
#if defined FOO
2323
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifdef [modernize-use-concise-preprocessor-directives]
2424
// CHECK-FIXES-23: #elifdef BAR
2525
#elif defined BAR
2626
#endif
2727

28-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
29-
// CHECK-FIXES-ALL: #ifdef FOO
28+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
29+
// CHECK-FIXES: #ifdef FOO
3030
#if (defined(FOO))
3131
// CHECK-MESSAGES-23: :[[@LINE+2]]:4: warning: preprocessor condition can be written more concisely using #elifdef [modernize-use-concise-preprocessor-directives]
3232
// CHECK-FIXES-23: # elifdef BAR
3333
# elif (defined(BAR))
3434
#endif
3535

36-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
37-
// CHECK-FIXES-ALL: #ifdef FOO
36+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifdef [modernize-use-concise-preprocessor-directives]
37+
// CHECK-FIXES: #ifdef FOO
3838
#if (defined FOO)
3939
// CHECK-MESSAGES-23: :[[@LINE+2]]:4: warning: preprocessor condition can be written more concisely using #elifdef [modernize-use-concise-preprocessor-directives]
4040
// CHECK-FIXES-23: # elifdef BAR
4141
# elif (defined BAR)
4242
#endif
4343

44-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
45-
// CHECK-FIXES-ALL: #ifndef FOO
44+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
45+
// CHECK-FIXES: #ifndef FOO
4646
#if !defined(FOO)
4747
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifndef [modernize-use-concise-preprocessor-directives]
4848
// CHECK-FIXES-23: #elifndef BAR
@@ -59,8 +59,8 @@
5959
#endif
6060
#endif // __cplusplus
6161

62-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
63-
// CHECK-FIXES-ALL: #ifndef FOO
62+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
63+
// CHECK-FIXES: #ifndef FOO
6464
#if !defined FOO
6565
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifndef [modernize-use-concise-preprocessor-directives]
6666
// CHECK-FIXES-23: #elifndef BAR
@@ -77,32 +77,32 @@
7777
#endif
7878
#endif // __cplusplus
7979

80-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
81-
// CHECK-FIXES-ALL: #ifndef FOO
80+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
81+
// CHECK-FIXES: #ifndef FOO
8282
#if (!defined(FOO))
8383
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifndef [modernize-use-concise-preprocessor-directives]
8484
// CHECK-FIXES-23: #elifndef BAR
8585
#elif (!defined(BAR))
8686
#endif
8787

88-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
89-
// CHECK-FIXES-ALL: #ifndef FOO
88+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
89+
// CHECK-FIXES: #ifndef FOO
9090
#if (!defined FOO)
9191
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifndef [modernize-use-concise-preprocessor-directives]
9292
// CHECK-FIXES-23: #elifndef BAR
9393
#elif (!defined BAR)
9494
#endif
9595

96-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
97-
// CHECK-FIXES-ALL: #ifndef FOO
96+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
97+
// CHECK-FIXES: #ifndef FOO
9898
#if !(defined(FOO))
9999
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifndef [modernize-use-concise-preprocessor-directives]
100100
// CHECK-FIXES-23: #elifndef BAR
101101
#elif !(defined(BAR))
102102
#endif
103103

104-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
105-
// CHECK-FIXES-ALL: #ifndef FOO
104+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
105+
// CHECK-FIXES: #ifndef FOO
106106
#if !(defined FOO)
107107
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifndef [modernize-use-concise-preprocessor-directives]
108108
// CHECK-FIXES-23: #elifndef BAR
@@ -113,16 +113,16 @@
113113
// handling them doesn't really add any complexity to the implementation.
114114
// Test them for good measure.
115115

116-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
117-
// CHECK-FIXES-ALL: #ifndef FOO
116+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
117+
// CHECK-FIXES: #ifndef FOO
118118
#if !((!!(defined(FOO))))
119119
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifdef [modernize-use-concise-preprocessor-directives]
120120
// CHECK-FIXES-23: #elifdef BAR
121121
#elif ((!(!(defined(BAR)))))
122122
#endif
123123

124-
// CHECK-MESSAGES-ALL: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
125-
// CHECK-FIXES-ALL: #ifndef FOO
124+
// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #ifndef [modernize-use-concise-preprocessor-directives]
125+
// CHECK-FIXES: #ifndef FOO
126126
#if !((!!(defined FOO)))
127127
// CHECK-MESSAGES-23: :[[@LINE+2]]:2: warning: preprocessor condition can be written more concisely using #elifdef [modernize-use-concise-preprocessor-directives]
128128
// CHECK-FIXES-23: #elifdef BAR

0 commit comments

Comments
 (0)