llvm-project/lldb/test/Shell/Breakpoint/case-sensitive.test

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.6 KiB
Plaintext
Raw Normal View History

# UNSUPPORTED: system-windows
Add "lldb-test breakpoint" command and convert the case-sensitivity test to use it Summary: The command takes two input arguments: a module to use as a debug target and a file containing a list of commands. The command will execute each of the breakpoint commands in the file and dump the breakpoint state after each one. The commands are expected to be breakpoint set/remove/etc. commands, but I explicitly allow any lldb command here, so you can do things like change setting which impact breakpoint resolution, etc. There is also a "-persistent" flag, which causes lldb-test to *not* automatically clear the breakpoint list after each command. Right now I don't use it, but the idea behind it was that it could be used to test more complex combinations of breakpoint commands (set+modify, set+disable, etc.). Right now the command prints out only the basic breakpoint state, but more information can be easily added there. To enable easy matching of the "at least one breakpoint location found" state, the command explicitly prints out the string "At least one breakpoint location.". To enable testing of breakpoints set with an absolute paths, I add the ability to perform rudimentary substitutions on the commands: right now the string %p is replaced by the directory which contains the command file (so, under normal circumstances, this will perform the same substitution as lit would do for %p). I use this command to rewrite the TestBreakpointCaseSensitivity test -- the test was checking about a dozen breakpoint commands, but it was launching a new process for each one, so it took about 90 seconds to run. The new test takes about 0.3 seconds for me, which is approximately a 300x speedup. Reviewers: davide, zturner, jingham Subscribers: luporl, lldb-commits Differential Revision: https://reviews.llvm.org/D43686 llvm-svn: 326112
2018-02-27 02:50:16 +08:00
#
# RUN: %build %p/Inputs/case-sensitive.c --nodefaultlib -o %t
Add "lldb-test breakpoint" command and convert the case-sensitivity test to use it Summary: The command takes two input arguments: a module to use as a debug target and a file containing a list of commands. The command will execute each of the breakpoint commands in the file and dump the breakpoint state after each one. The commands are expected to be breakpoint set/remove/etc. commands, but I explicitly allow any lldb command here, so you can do things like change setting which impact breakpoint resolution, etc. There is also a "-persistent" flag, which causes lldb-test to *not* automatically clear the breakpoint list after each command. Right now I don't use it, but the idea behind it was that it could be used to test more complex combinations of breakpoint commands (set+modify, set+disable, etc.). Right now the command prints out only the basic breakpoint state, but more information can be easily added there. To enable easy matching of the "at least one breakpoint location found" state, the command explicitly prints out the string "At least one breakpoint location.". To enable testing of breakpoints set with an absolute paths, I add the ability to perform rudimentary substitutions on the commands: right now the string %p is replaced by the directory which contains the command file (so, under normal circumstances, this will perform the same substitution as lit would do for %p). I use this command to rewrite the TestBreakpointCaseSensitivity test -- the test was checking about a dozen breakpoint commands, but it was launching a new process for each one, so it took about 90 seconds to run. The new test takes about 0.3 seconds for me, which is approximately a 300x speedup. Reviewers: davide, zturner, jingham Subscribers: luporl, lldb-commits Differential Revision: https://reviews.llvm.org/D43686 llvm-svn: 326112
2018-02-27 02:50:16 +08:00
# RUN: lldb-test breakpoints %t %s | FileCheck %s
breakpoint set -f case-sensitive.c -l 3
# CHECK-LABEL: breakpoint set -f case-sensitive.c -l 3
# CHECK: At least one location.
breakpoint set -f %p/Inputs/case-sensitive.c -l 3
# CHECK-LABEL: breakpoint set -f {{.*}}/Inputs/case-sensitive.c -l 3
# CHECK: At least one location.
breakpoint set -f %p/INPUTS/case-sensitive.c -l 3
# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/case-sensitive.c -l 3
# CHECK: 0 locations.
breakpoint set -f Case-Sensitive.c -l 3
# CHECK-LABEL: breakpoint set -f Case-Sensitive.c -l 3
# CHECK: 0 locations.
breakpoint set -f %p/INPUTS/Case-Sensitive.c -l 3
# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/Case-Sensitive.c -l 3
# CHECK: 0 locations.
breakpoint set -f case-sensitive.c -p REGEX-THIS
# CHECK-LABEL: breakpoint set -f case-sensitive.c -p REGEX-THIS
# CHECK: At least one location.
breakpoint set -f %p/Inputs/case-sensitive.c -p REGEX-THIS
# CHECK-LABEL: breakpoint set -f {{.*}}/Inputs/case-sensitive.c -p REGEX-THIS
# CHECK: At least one location.
breakpoint set -f %p/INPUTS/case-sensitive.c -p REGEX-THIS
# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/case-sensitive.c -p REGEX-THIS
# CHECK: 0 locations.
breakpoint set -f Case-Sensitive.c -p REGEX-THIS
# CHECK-LABEL: breakpoint set -f Case-Sensitive.c -p REGEX-THIS
# CHECK: 0 locations.
breakpoint set -f %p/INPUTS/Case-Sensitive.c -p REGEX-THIS
# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/Case-Sensitive.c -p REGEX-THIS
# CHECK: 0 locations.