xref: /llvm-project/lldb/test/Shell/Commands/command-image-lookup-color.test (revision 61f18255fab3c404dc43a59091a750c22e5d0ccb)
1# RUN: %clang_host -g %S/Inputs/main.c -o %t
2
3# The file main.c is does not show up in search on Windows.
4# UNSUPPORTED: system-windows
5
6# Until we figure out the correct CHECK lines.
7# UNSUPPORTED: system-darwin
8
9# Checking simple regex search
10
11# RUN: %lldb %t -b -o 'settings set use-color true' -o 'image lookup -r -s ma' | FileCheck %s --check-prefix CHECK1
12# CHECK1:         Name: {{.+}}31mma{{.+}}0min.c
13
14# Checking complex regex searches
15
16# RUN: %lldb %t -b -o 'settings set use-color true' -o 'image lookup -r -s main.c|foo' | FileCheck %s --check-prefix CHECK2
17# CHECK2:         Name: {{.+}}31mmain.c{{.+}}0m
18
19# RUN: %lldb %t -b -o 'settings set use-color true' -o 'image lookup -r -s m[abc]' | FileCheck %s --check-prefix CHECK3
20# CHECK3:         Name: {{.+}}31mma{{.+}}0min.c
21
22# Checking to ensure that no attempt is made to color anything when there are no matching symbols found
23
24# RUN: %lldb %t -o 'settings set use-color true' -o 'image lookup -r -s IMPPATTERN123456' | FileCheck %s --check-prefix CHECK4
25# CHECK4-NOT: {{[0-9]+}} symbols match the regular expression
26
27# Checking multiple matches on same symbol
28
29# RUN: %lldb %t -b -o 'settings set use-color true' -o 'image lookup -r -s (ma|n)' | FileCheck %s --check-prefix CHECK5
30# CHECK5:         Name: {{.+}}31mma{{.+}}0mi{{.+}}31mn{{.+}}0m.c
31
32# Checking no colorization without regex search
33
34# RUN: %lldb %t -b -o 'settings set use-color true' -o 'image lookup -s main' | FileCheck %s --check-prefix CHECK6
35# CHECK6:        Summary: {{.+}}`main at main.c:
36
37# Checking no colorization when use-color is false
38
39# RUN: %lldb %t -b -o 'settings set use-color false' -o 'image lookup -r -s ma' | FileCheck %s --check-prefix CHECK7
40# CHECK7:        Name: main.c
41
42# Checking for custom colors
43
44# RUN: %lldb %t -b -o 'settings set use-color true' -o 'settings set show-regex-match-ansi-prefix ${ansi.fg.green}' -o 'image lookup -r -s ma' | FileCheck %s --check-prefix CHECK8
45# CHECK8:         Name: {{.+}}32mma{{.+}}0min.c
46
47# Checking for functionality when there's prefix but no suffix
48
49# RUN: %lldb %t -b -o 'settings set use-color true' -o 'settings set show-regex-match-ansi-prefix ${ansi.fg.red}' -o 'settings set show-regex-match-ansi-suffix ""' -o 'image lookup -r -s ma' | FileCheck %s --check-prefix CHECK9
50# CHECK9:         Name: {{.+}}31mmain.c
51
52# Checking for functionality when there's suffix but no prefix
53
54# RUN: %lldb %t -b -o 'settings set use-color true' -o 'settings set show-regex-match-ansi-prefix ""' -o 'settings set show-regex-match-ansi-suffix ${ansi.fg.red}' -o 'image lookup -r -s ma' | FileCheck %s --check-prefix CHECK10
55# CHECK10:         Name: ma{{.+}}31min.c
56
57# Checking for no colorization when there's neither suffix nor prefix
58
59# RUN: %lldb %t -b -o 'settings set use-color true' -o 'settings set show-regex-match-ansi-prefix ""' -o 'settings set show-regex-match-ansi-suffix ""' -o 'image lookup -r -s ma' | FileCheck %s --check-prefix CHECK11
60# CHECK11:         Name: main.c
61