[Pkg-bazaar-commits] ./bzr/unstable r340: - more testcase fixes

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


------------------------------------------------------------
revno: 340
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-05-03 22:37:47 +1000
message:
  - more testcase fixes
  - remove test.sh in favour of testbzr
removed:
  test.sh
modified:
  NEWS
  bzrlib/tests.py
  testbzr
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2005-05-03 07:48:16 +0000
+++ b/NEWS	2005-05-03 12:37:47 +0000
@@ -12,8 +12,9 @@
 
   TESTING:
 
-    * Converted black-box test suites from Bourne shell into Python.
-      Various structural improvements to the tests.
+    * Converted black-box test suites from Bourne shell into Python;
+      now run using ``./testbzr``.  Various structural improvements to
+      the tests.
 
   INTERNAL:
 

=== modified file 'bzrlib/tests.py'
--- a/bzrlib/tests.py	2005-04-05 13:46:36 +0000
+++ b/bzrlib/tests.py	2005-05-03 12:37:47 +0000
@@ -30,10 +30,6 @@
 >>> import bzrlib, os
 >>> from bzrlib import ScratchBranch
 >>> from bzrlib.osutils import isdir, isfile
->>> bzrlib.commands.cmd_rocks()
-it sure does!
-
-Hey, nice place to begin.
 
 The basic object is a Branch.  We have a special helper class
 ScratchBranch that automatically makes a directory and cleans itself
@@ -211,8 +207,6 @@
     foo => subdir/foo
     >>> b.show_status()
     R       foo => subdir/foo
-    >>> bzrlib.commands.cmd_renames(b.base)
-    foo => subdir/foo
     >>> b.commit("move foo to subdir")
     >>> isfile(b.abspath('foo'))
     False

=== removed file 'test.sh'
--- a/test.sh	2005-04-26 10:37:53 +0000
+++ b/test.sh	1970-01-01 00:00:00 +0000
@@ -1,149 +0,0 @@
-#! /bin/sh -pe
-
-# Simple shell-based tests for bzr.
-
-# This is meant to exercise the external behaviour, command line
-# parsing and similar things and compliment the inwardly-turned
-# testing done by doctest.
-
-# This must already exist and be in the right place
-if ! [ -d bzr-test.tmp ] 
-then
-    echo "please create directory bzr-test.tmp"
-    exit 1
-fi
-
-echo "testing `which bzr`"
-bzr --version | head -n 1
-echo
-
-rm -rf bzr-test.tmp
-mkdir bzr-test.tmp
-
-# save it for real errors
-exec 3>&2
-
-exec > bzr-test.log
-exec 2>&1 
-set -x
-
-quitter() {
-    echo "tests failed, look in bzr-test.log" >&3; exit 2; 
-}
-
-trap quitter ERR
-
-cd bzr-test.tmp 
-rm -rf .bzr
-
-mkdir branch1
-cd branch1
-
-# some information commands
-bzr help
-bzr version
-
-[ $(bzr help commands | wc -l) -gt 20 ]
-
-# user identification is set
-bzr whoami
-bzr whoami --email
-
-# invalid commands are detected
-! bzr pants
-
-# TODO: test unicode user names
-
-bzr help
-
-# some experiments with renames
-bzr init
-echo "hello world" > test.txt
-bzr unknowns
-
-# should be the only unknown file
-[ "`bzr unknowns`" = test.txt ]
-
-bzr status --all > status.tmp
-! diff -u - status.tmp <<EOF
-?       status.tmp
-?       test.txt
-EOF
-
-# command alias
-bzr st --all | diff -u - status.tmp
-
-# can't rename unversioned files; use the regular unix rename command
-! bzr rename test.txt new-test.txt
-
-# ok, so now add it and see what happens
-bzr add test.txt
-[ -z "`bzr unknowns`" ]
-
-# after adding even before committing you can rename files
-bzr rename test.txt newname.txt
-[ "`bzr status`" = "A       newname.txt" ]
-
-[ `bzr revno` = 0 ]
-bzr commit -m "add first revision"
-[ `bzr revno` = 1 ]
-
-# now more complicated renames
-mkdir sub1
-! bzr rename newname.txt sub1
-! bzr rename newname.txt sub1/foo.txt
-bzr add sub1
-! bzr rename newname.txt sub1
-
-bzr rename newname.txt sub1/foo.txt
-[ -f sub1/foo.txt ]
-[ ! -f newname.txt ]
-
-bzr rename sub1/foo.txt newname.txt
-[ -f newname.txt ]
-
-bzr rename newname.txt sub1/foo.txt
-bzr rename sub1/foo.txt sub1/bar.txt
-
-cd sub1
-mkdir sub2
-bzr add sub2
-bzr rename bar.txt sub2/bar.txt
-cd sub2
-bzr rename bar.txt ../../bar.txt
-cd ../../
-
-bzr commit -m "more renames"
-[ `bzr revno` = 2 ] 
-
-# now try pulling that file back out, checking it was stored properly
-[ "`bzr cat -r 1 newname.txt`" = "hello world" ]
-
-! bzr rename sub1 sub1/knotted-up
-
-
-
-
-
-# now test hardlinked branches in subdirectories
-cd ..
-[ -d branch2 ] && rm -rf branch2
-cp -al branch1 branch2
-
-cd branch2
-bzr log 
-[ `bzr revno` = 2 ]
-
-echo "added in branch2" > new-in-2.txt
-bzr add new-in-2.txt
-bzr commit -m "add file to branch 2 only"
-
-[ `bzr revno` = 3 ]
-
-cd ../branch1
-[ `bzr revno` = 2 ]
-
-bzr check
-
-
-echo "tests completed ok" >&3

=== modified file 'testbzr'
--- a/testbzr	2005-05-03 09:27:28 +0000
+++ b/testbzr	2005-05-03 12:37:47 +0000
@@ -110,6 +110,7 @@
     logfile.write('   at %s:%d\n' % stack[:2])
 
 
+
 # prepare an empty scratch directory
 if os.path.exists(TESTDIR):
     shutil.rmtree(TESTDIR)
@@ -207,9 +208,13 @@
 
     cd('sub1/sub2')
     runcmd('bzr move ../hello.txt .')
-    assert exists('../hello.txt')
+    assert exists('./hello.txt')
     runcmd(['bzr', 'commit', '-m', 'move to parent directory'])
     cd('..')
+
+    runcmd('bzr move sub2/hello.txt .')
+    assert exists('hello.txt')
+    
     
     cd('..')
 



More information about the Pkg-bazaar-commits mailing list