"os"
"os/exec"
"path/filepath"
- "regexp"
"runtime"
"strings"
"testing"
if target:
print "Created target"
main_bp = target.BreakpointCreateByLocation("main.go", 10)
- if main_bp.GetNumLocations() != 0:
+ if main_bp:
print "Created breakpoint"
- else:
- # This happens if lldb can't read the program's DWARF. See https://golang.org/issue/25925.
- print "SKIP: no matching locations for breakpoint"
- exit(1)
process = target.LaunchSimple(None, None, os.getcwd())
if process:
print "Process launched"
if state in [lldb.eStateUnloaded, lldb.eStateLaunching, lldb.eStateRunning]:
continue
else:
- print "SKIP: Timeout launching"
+ print "Timeout launching"
break
if state == lldb.eStateStopped:
for t in process.threads:
got, _ := cmd.CombinedOutput()
if string(got) != expectedLldbOutput {
- skipReason := regexp.MustCompile("SKIP: .*\n").Find(got)
- if skipReason != nil {
- t.Skip(string(skipReason))
+ if strings.Contains(string(got), "Timeout launching") {
+ t.Skip("Timeout launching")
}
t.Fatalf("Unexpected lldb output:\n%s", got)
}