[Pkg-bazaar-commits] ./bzr/unstable r297: - fix intentional testcase failure

Martin Pool mbp at sourcefrog.net
Fri Apr 10 07:43:51 UTC 2009


------------------------------------------------------------
revno: 297
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Thu 2005-04-28 19:03:12 +1000
message:
  - fix intentional testcase failure
  - log line numbers from test case
  - test whoami command
modified:
  NEWS
  testbzr
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2005-04-28 08:50:42 +0000
+++ b/NEWS	2005-04-28 09:03:12 +0000
@@ -7,9 +7,10 @@
 
   TESTING:
 
-    * Converted black-box test suites from Bourne shell into Python. 
-
-
+    * Converted black-box test suites from Bourne shell into Python.
+      Various structural improvements to the tests.
+
+
 bzr-0.0.4  2005-04-22
 
   ENHANCEMENTS:

=== modified file 'testbzr'
--- a/testbzr	2005-04-28 08:50:42 +0000
+++ b/testbzr	2005-04-28 09:03:12 +0000
@@ -48,6 +48,7 @@
     
     if isinstance(cmd, basestring):
         cmd = cmd.split()
+    log_linenumber()
     logfile.write('$ %r\n' % cmd)
     retcode = call(cmd, stdout=logfile, stderr=logfile)
     if retcode != 0:
@@ -57,16 +58,23 @@
 def progress(msg):
     print '* ' + msg
     logfile.write('* '+ msg + '\n')
-
-
-TESTDIR = "bzr-test.tmp"
+    log_linenumber()
+
+
+def log_linenumber():
+    """Log the stack frame location two things up."""
+    stack = traceback.extract_stack()[-3]
+    logfile.write('   at %s:%d\n' % stack[:2])
+
+
+TESTDIR = "testbzr.tmp"
 
 # prepare an empty scratch directory
 if os.path.exists(TESTDIR):
     shutil.rmtree(TESTDIR)
 
 
-logfile = open('bzr-test.log', 'wt')
+logfile = open('testbzr.log', 'wt', buffering=1)
 
 
 try: 
@@ -77,7 +85,11 @@
     progress("testing introductory commands")
     runcmd("bzr version")
     runcmd("bzr help")
-    runcmd("bzr --helpx")
+    runcmd("bzr --help")
+
+    progress("testing user identity")
+    # this should always identify something, if only "john at localhost"
+    runcmd("bzr whoami")
 
     progress("all tests passed!")
 except Exception, e:



More information about the Pkg-bazaar-commits mailing list