1 // Sanity-check. Run without modules:
2 // RUN: rm -rf %t
3 // RUN: mkdir %t
4 // RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
5 // RUN: %check_clang_tidy -std=c++11 %s readability-identifier-naming %t/without-modules -- \
6 // RUN:   -config="CheckOptions: [{ \
7 // RUN:      key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \
8 // RUN:   -header-filter=.* \
9 // RUN:   -- -I %t/
10 //
11 // RUN: rm -rf %t
12 // RUN: mkdir %t
13 // RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
14 // RUN: %check_clang_tidy -std=c++17 %s readability-identifier-naming %t/without-modules -- \
15 // RUN:   -config="CheckOptions: [{ \
16 // RUN:      key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \
17 // RUN:   -header-filter=.* \
18 // RUN:   -- -I %t/
19 //
20 // Run clang-tidy on a file with modular includes:
21 //
22 // RUN: rm -rf %t
23 // RUN: mkdir %t
24 // RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
25 // RUN: %check_clang_tidy -std=c++11 %s readability-identifier-naming %t/with-modules -- \
26 // RUN:   -config="CheckOptions: [{ \
27 // RUN:      key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \
28 // RUN:   -header-filter=.* \
29 // RUN:   -- -I %t/ \
30 // RUN:   -fmodules -fimplicit-modules -fno-implicit-module-maps \
31 // RUN:   -fmodule-map-file=%t/module.modulemap \
32 // RUN:   -fmodules-cache-path=%t/module-cache/
33 //
34 // RUN: rm -rf %t
35 // RUN: mkdir %t
36 // RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
37 // RUN: %check_clang_tidy -std=c++17 %s readability-identifier-naming %t/with-modules -- \
38 // RUN:   -config="CheckOptions: [{ \
39 // RUN:      key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }]" \
40 // RUN:   -header-filter=.* \
41 // RUN:   -- -I %t/ \
42 // RUN:   -fmodules -fimplicit-modules -fno-implicit-module-maps \
43 // RUN:   -fmodule-map-file=%t/module.modulemap \
44 // RUN:   -fmodules-cache-path=%t/module-cache/
45 // FIXME: Make the test work in all language modes.
46 #include "c.h"
47 
48 // CHECK-MESSAGES: a.h:1:9: warning: invalid case style for macro definition 'a' [readability-identifier-naming]
49 // CHECK-MESSAGES: a.h:1:9: note: FIX-IT applied suggested code changes
50 // CHECK-MESSAGES: b.h:2:9: warning: invalid case style for macro definition 'b'
51 // CHECK-MESSAGES: b.h:2:9: note: FIX-IT applied suggested code changes
52 // CHECK-MESSAGES: c.h:2:9: warning: invalid case style for macro definition 'c'
53 // CHECK-MESSAGES: c.h:2:9: note: FIX-IT applied suggested code changes
54 
55 #define m
56 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for macro definition 'm'
57 // CHECK-MESSAGES: :[[@LINE-2]]:9: note: FIX-IT applied suggested code changes
58