~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testbzr

  • Committer: Martin Pool
  • Date: 2005-05-03 08:04:38 UTC
  • Revision ID: mbp@sourcefrog.net-20050503080438-eafcce8d628e9b30
- add new failing test for command parsing

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import sys, os, traceback
28
28
 
 
29
TESTDIR = "testbzr.tmp"
 
30
 
 
31
LOGFILENAME = 'testbzr.log'
 
32
 
29
33
try:
30
34
    import shutil
31
35
    from subprocess import call, Popen, PIPE
104
108
    logfile.write('   at %s:%d\n' % stack[:2])
105
109
 
106
110
 
107
 
TESTDIR = "testbzr.tmp"
108
 
 
109
111
# prepare an empty scratch directory
110
112
if os.path.exists(TESTDIR):
111
113
    shutil.rmtree(TESTDIR)
112
114
 
113
115
 
114
 
logfile = open('testbzr.log', 'wt', buffering=1)
 
116
logfile = open(LOGFILENAME, 'wt', buffering=1)
115
117
 
116
118
 
117
119
try:
120
122
 
121
123
    progress("introductory commands")
122
124
    runcmd("bzr version")
 
125
    runcmd("bzr --version")
123
126
    runcmd("bzr help")
124
127
    runcmd("bzr --help")
125
128
 
175
178
except Exception, e:
176
179
    sys.stderr.write('*' * 50 + '\n'
177
180
                     + 'testbzr: tests failed\n'
178
 
                     + 'see testbzr.log for more information\n'
 
181
                     + 'see ' + LOGFILENAME + ' for more information\n'
179
182
                     + '*' * 50 + '\n')
180
183
    logfile.write('tests failed!\n')
181
184
    traceback.print_exc(None, logfile)