[Pkg-bazaar-commits] ./bzr/unstable r398: - testbzr finds the right version of bzr to test

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


------------------------------------------------------------
revno: 398
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-05-09 11:18:48 +1000
message:
  - testbzr finds the right version of bzr to test
modified:
  NEWS
  testbzr
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2005-05-09 00:00:23 +0000
+++ b/NEWS	2005-05-09 01:18:48 +0000
@@ -31,6 +31,10 @@
       now run using ``./testbzr``.  Various structural improvements to
       the tests.
 
+    * testbzr by default runs the version of bzr found in the same
+      directory as the tests, or the one given as the first parameter.
+
+
   INTERNAL:
 
     * Included ElementTree library upgraded to 1.2.6 by Fredrik Lundh.

=== modified file 'testbzr'
--- a/testbzr	2005-05-08 03:33:57 +0000
+++ b/testbzr	2005-05-09 01:18:48 +0000
@@ -52,6 +52,9 @@
     else:
         logfile.write('$ %r\n' % cmd)
 
+    if cmd[0] == 'bzr':
+        cmd[0] = BZRPATH
+
     return cmd
 
 
@@ -120,6 +123,20 @@
 
 
 try:
+    mypath = os.path.abspath(sys.argv[0])
+    print 'running tests from', mypath
+
+    global BZRPATH
+
+    if len(sys.argv) > 1:
+        BZRPATH = sys.argv[1]
+    else:
+        BZRPATH = os.path.join(os.path.split(mypath)[0], 'bzr')
+
+    print 'against bzr', BZRPATH
+    print
+    print backtick([BZRPATH, 'version'])
+    
     runcmd(['mkdir', TESTDIR])
     cd(TESTDIR)
 



More information about the Pkg-bazaar-commits mailing list