[Pkg-bazaar-commits] ./bzr/unstable r299: testbzr:

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


------------------------------------------------------------
revno: 299
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Thu 2005-04-28 19:07:38 +1000
message:
  testbzr:
  - log directory changes
  - better logging of commands
modified:
  testbzr
-------------- next part --------------
=== modified file 'testbzr'
--- a/testbzr	2005-04-28 09:05:39 +0000
+++ b/testbzr	2005-04-28 09:07:38 +0000
@@ -47,9 +47,11 @@
     pass a list instead."""
     
     if isinstance(cmd, basestring):
+        logfile.write('$ %s\n' % cmd)
         cmd = cmd.split()
+    else:
+        logfile.write('$ %r\n' % cmd)
     log_linenumber()
-    logfile.write('$ %r\n' % cmd)
     actual_retcode = call(cmd, stdout=logfile, stderr=logfile)
     if retcode != actual_retcode:
         raise CommandFailed("test failed: %r returned %d, expected %d"
@@ -62,6 +64,11 @@
     log_linenumber()
 
 
+def cd(dirname):
+    logfile.write('$ cd %s\n' % dirname)
+    os.chdir(dirname)
+
+
 def log_linenumber():
     """Log the stack frame location two things up."""
     stack = traceback.extract_stack()[-3]
@@ -80,8 +87,7 @@
 
 try: 
     os.mkdir(TESTDIR)
-    os.chdir(TESTDIR)
-
+    cd(TESTDIR)
 
     progress("testing introductory commands")
     runcmd("bzr version")



More information about the Pkg-bazaar-commits mailing list