summaryrefslogtreecommitdiffstats
path: root/lldb/test/global_variables/TestGlobalVariables.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-08-09 23:44:24 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-08-09 23:44:24 +0000
commit1794184ada29ba245486b999249341eb19367e8a (patch)
treed826c0ae1bd1ec2ff8db4d79d2e700bdacc2b88e /lldb/test/global_variables/TestGlobalVariables.py
parent5aee162f978eac7ffb6363d25b193e51edfbc0b1 (diff)
downloadbcm5719-llvm-1794184ada29ba245486b999249341eb19367e8a.tar.gz
bcm5719-llvm-1794184ada29ba245486b999249341eb19367e8a.zip
Modified the remaining test cases to display more meaningful assert messages.
Added a generic message generator to the lldbtest.py base module. llvm-svn: 110625
Diffstat (limited to 'lldb/test/global_variables/TestGlobalVariables.py')
-rw-r--r--lldb/test/global_variables/TestGlobalVariables.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/lldb/test/global_variables/TestGlobalVariables.py b/lldb/test/global_variables/TestGlobalVariables.py
index c6899f3d950..0cc557fe6d5 100644
--- a/lldb/test/global_variables/TestGlobalVariables.py
+++ b/lldb/test/global_variables/TestGlobalVariables.py
@@ -3,9 +3,9 @@
import os, time
import unittest2
import lldb
-import lldbtest
+from lldbtest import *
-class TestGlobalVariables(lldbtest.TestBase):
+class TestGlobalVariables(TestBase):
mydir = "global_variables"
@@ -14,29 +14,32 @@ class TestGlobalVariables(lldbtest.TestBase):
res = self.res
exe = os.path.join(os.getcwd(), "a.out")
self.ci.HandleCommand("file " + exe, res)
- self.assertTrue(res.Succeeded())
+ self.assertTrue(res.Succeeded(), CURRENT_EXECUTABLE_SET)
# Break inside the main.
self.ci.HandleCommand("breakpoint set -f main.c -l 20", res)
self.assertTrue(res.Succeeded())
self.assertTrue(res.GetOutput().startswith(
- "Breakpoint created: 1: file ='main.c', line = 20, locations = 1"))
+ "Breakpoint created: 1: file ='main.c', line = 20, locations = 1"),
+ BREAKPOINT_CREATED)
self.ci.HandleCommand("run", res)
- time.sleep(0.1)
- self.assertTrue(res.Succeeded())
+ #time.sleep(0.1)
+ self.assertTrue(res.Succeeded(), RUN_STOPPED)
# The stop reason of the thread should be breakpoint.
self.ci.HandleCommand("thread list", res)
- print "thread list ->", res.GetOutput()
- self.assertTrue(res.Succeeded())
+ #print "thread list ->", res.GetOutput()
+ self.assertTrue(res.Succeeded(), CMD_MSG('thread list'))
self.assertTrue(res.GetOutput().find('state is Stopped') > 0 and
- res.GetOutput().find('stop reason = breakpoint') > 0)
+ res.GetOutput().find('stop reason = breakpoint') > 0,
+ STOPPED_DUE_TO_BREAKPOINT)
# The breakpoint should have a hit count of 1.
self.ci.HandleCommand("breakpoint list", res)
self.assertTrue(res.Succeeded())
- self.assertTrue(res.GetOutput().find(' resolved, hit count = 1') > 0)
+ self.assertTrue(res.GetOutput().find(' resolved, hit count = 1') > 0,
+ BREAKPOINT_HIT_ONCE)
# Check that GLOBAL scopes are indicated for the variables.
self.ci.HandleCommand("variable list -s -a", res);
@@ -47,7 +50,8 @@ class TestGlobalVariables(lldbtest.TestBase):
output.find('GLOBAL: g_file_global_int') > 0 and
output.find('(int) 42') > 0 and
output.find('GLOBAL: g_file_global_cstr') > 0 and
- output.find('g_file_global_cstr') > 0)
+ output.find('g_file_global_cstr') > 0,
+ VARIABLES_DISPLAYED_CORRECTLY)
self.ci.HandleCommand("continue", res)
self.assertTrue(res.Succeeded())
OpenPOWER on IntegriCloud