bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
169
by mbp at sourcefrog
Start of shell-based black-box testing in test.sh |
1 |
#! /bin/sh -pe
|
2 |
||
3 |
# Simple shell-based tests for bzr.
|
|
4 |
||
5 |
# This is meant to exercise the external behaviour, command line
|
|
6 |
# parsing and similar things and compliment the inwardly-turned
|
|
7 |
# testing done by doctest.
|
|
8 |
||
9 |
# This must already exist and be in the right place
|
|
10 |
if ! [ -d bzr-test.tmp ] |
|
11 |
then
|
|
12 |
echo "please create bzr-test.tmp" |
|
13 |
exit 1 |
|
14 |
fi
|
|
15 |
||
16 |
rm -rf bzr-test.tmp |
|
17 |
mkdir bzr-test.tmp
|
|
18 |
||
19 |
exec > bzr-test.log |
|
20 |
exec 2>&1 |
|
21 |
set -x |
|
22 |
||
23 |
cd bzr-test.tmp |
|
24 |
rm -rf .bzr |
|
25 |
||
26 |
# some information commands
|
|
27 |
bzr help |
|
28 |
bzr version
|
|
29 |
||
30 |
# invalid commands are detected
|
|
31 |
! bzr pants |
|
32 |
||
33 |
# some experiments with renames
|
|
34 |
bzr init
|
|
35 |
echo "hello world" > test.txt |
|
36 |
bzr unknowns
|
|
37 |
||
38 |
# should be the only unknown file
|
|
39 |
[ "`bzr unknowns`" = test.txt ] |
|
40 |
||
41 |
# can't rename unversioned files; use the regular unix rename command
|
|
42 |
! bzr rename test.txt new-test.txt |
|
43 |
||
44 |
# ok, so now add it and see what happens
|
|
45 |
bzr add test.txt |
|
46 |
[ -z "`bzr unknowns`" ] |
|
47 |
||
48 |
# after adding even before committing you can rename files
|
|
49 |
bzr rename test.txt newname.txt |
|
50 |
[ "`bzr status`" = "A newname.txt" ] |
|
51 |
||
52 |
bzr commit -m "add first revision" |
|
53 |
||
54 |
# now more complicated renames
|
|
55 |
mkdir sub1
|
|
56 |
! bzr rename newname.txt sub1 |
|
57 |
! bzr rename newname.txt sub1/foo.txt |
|
58 |
bzr add sub1 |
|
59 |
! bzr rename newname.txt sub1 |
|
60 |
||
61 |
bzr rename newname.txt sub1/foo.txt |
|
62 |
[ -f sub1/foo.txt ] |
|
63 |
[ ! -f newname.txt ] |
|
64 |
||
65 |
bzr rename sub1/foo.txt newname.txt |
|
66 |
[ -f newname.txt ] |
|
67 |
||
68 |
bzr rename newname.txt sub1/foo.txt |
|
69 |
bzr rename sub1/foo.txt sub1/bar.txt |
|
70 |
||
71 |
cd sub1 |
|
72 |
mkdir sub2
|
|
73 |
bzr add sub2 |
|
74 |
bzr rename bar.txt sub2/bar.txt |
|
75 |
cd sub2 |
|
76 |
bzr rename bar.txt ../../bar.txt |
|
77 |
cd ../../ |
|
78 |
||
79 |
bzr commit -m "more renames" |
|
80 |
||
81 |
||
82 |
||
83 |
||
84 |