[lldb/Test] Make TestConvenienceVariables more strict

This test was passing even when the output of lldb.target was empty.
I've made the test more strict by checking explicitly for the target
name and by using CHECK-NEXT lines.
This commit is contained in:
Jonas Devlieghere 2020-01-07 13:05:39 -08:00
parent 39c05703a6
commit 4c935c66c4
1 changed files with 11 additions and 14 deletions

View File

@ -1,23 +1,20 @@
REQUIRES: python
RUN: %build %p/Inputs/hello.cpp -o %t
RUN: %lldb %t -s %p/Inputs/convenience.in -o quit | FileCheck %s
script print(lldb.debugger)
RUN: mkdir -p %t
RUN: %build %p/Inputs/hello.cpp -o %t/target.out
RUN: %lldb %t/target.out -s %p/Inputs/convenience.in -o quit | FileCheck %s
CHECK: stop reason = breakpoint 1.1
CHECK: Debugger (instance: {{.*}}, id: {{[0-9]+}})
CHECK: script print(lldb.debugger)
CHECK-NEXT: Debugger (instance: {{.*}}, id: {{[0-9]+}})
CHECK: script print(lldb.target)
CHECK: TestConvenienceVariables.test
CHECK-NEXT: target.out
CHECK: script print(lldb.process)
CHECK: SBProcess: pid = {{[0-9]+}},
CHECK-SAME: state = stopped,
CHECK-SAME: threads = {{[0-9]+}},
CHECK-SAME: executable = TestConvenienceVariables.test
CHECK-NEXT: SBProcess: pid = {{[0-9]+}}, state = stopped, threads = {{[0-9]+}}, executable = target.out
CHECK: script print(lldb.thread.GetStopDescription(100))
CHECK: breakpoint 1.1
CHECK-NEXT: breakpoint 1.1
CHECK: script lldb.frame.GetLineEntry().GetLine()
CHECK: 8
CHECK-NEXT: 8
CHECK: script lldb.frame.GetLineEntry().GetFileSpec().GetFilename()
CHECK: hello.c
CHECK-NEXT: hello.c
CHECK: script lldb.frame.GetFunctionName()
CHECK: main
CHECK-NEXT: main