aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-16 02:27:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-16 02:27:31 +0100
commit1e9bc2603dc6c9dc282058056e1c28bd817da488 (patch)
tree81387ab572370062665654b26231b68711e53e07
parentd084cb9dc70bfe4a56c2b4b83801ef8d991725f4 (diff)
downloadbusybox-w32-1e9bc2603dc6c9dc282058056e1c28bd817da488.tar.gz
busybox-w32-1e9bc2603dc6c9dc282058056e1c28bd817da488.tar.bz2
busybox-w32-1e9bc2603dc6c9dc282058056e1c28bd817da488.zip
cp: improve test coverage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xtestsuite/cp.tests162
1 files changed, 81 insertions, 81 deletions
diff --git a/testsuite/cp.tests b/testsuite/cp.tests
index 75a7dcb48..e81939df5 100755
--- a/testsuite/cp.tests
+++ b/testsuite/cp.tests
@@ -24,11 +24,11 @@ ln -s dir cp.testdir/dir_symlink
24 24
25rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 25rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
26testing "cp" '\ 26testing "cp" '\
27cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 27cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
28test ! -L cp.testdir2/file || echo BAD: file 28test ! -L file && test -f file || echo BAD: file
29test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 29test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
30test ! -e cp.testdir2/dir || echo BAD: dir 30test ! -L dir && test ! -e dir || echo BAD: dir
31test ! -e cp.testdir2/dir_symlink || echo BAD: dir_symlink 31test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
32' "\ 32' "\
33cp: omitting directory ${sq}dir' 33cp: omitting directory ${sq}dir'
34cp: omitting directory ${sq}dir_symlink' 34cp: omitting directory ${sq}dir_symlink'
@@ -37,11 +37,11 @@ cp: omitting directory ${sq}dir_symlink'
37 37
38rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 38rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
39testing "cp -d" '\ 39testing "cp -d" '\
40cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 40cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
41test ! -L cp.testdir2/file || echo BAD: file 41test ! -L file && test -f file || echo BAD: file
42test -L cp.testdir2/file_symlink || echo BAD: file_symlink 42test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
43test ! -e cp.testdir2/dir || echo BAD: dir 43test ! -L dir && test ! -e dir || echo BAD: dir
44test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 44test -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
45' "\ 45' "\
46cp: omitting directory ${sq}dir' 46cp: omitting directory ${sq}dir'
471 471
@@ -49,11 +49,11 @@ cp: omitting directory ${sq}dir'
49 49
50rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 50rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
51testing "cp -P" '\ 51testing "cp -P" '\
52cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 52cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
53test ! -L cp.testdir2/file || echo BAD: file 53test ! -L file && test -f file || echo BAD: file
54test -L cp.testdir2/file_symlink || echo BAD: file_symlink 54test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
55test ! -e cp.testdir2/dir || echo BAD: dir 55test ! -L dir && test ! -e dir || echo BAD: dir
56test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 56test -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
57' "\ 57' "\
58cp: omitting directory ${sq}dir' 58cp: omitting directory ${sq}dir'
591 591
@@ -61,11 +61,11 @@ cp: omitting directory ${sq}dir'
61 61
62rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 62rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
63testing "cp -L" '\ 63testing "cp -L" '\
64cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 64cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
65test ! -L cp.testdir2/file || echo BAD: file 65test ! -L file && test -f file || echo BAD: file
66test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 66test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
67test ! -e cp.testdir2/dir || echo BAD: dir 67test ! -L dir && test ! -e dir || echo BAD: dir
68test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 68test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
69' "\ 69' "\
70cp: omitting directory ${sq}dir' 70cp: omitting directory ${sq}dir'
71cp: omitting directory ${sq}dir_symlink' 71cp: omitting directory ${sq}dir_symlink'
@@ -74,11 +74,11 @@ cp: omitting directory ${sq}dir_symlink'
74 74
75rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 75rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
76testing "cp -H" '\ 76testing "cp -H" '\
77cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 77cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
78test ! -L cp.testdir2/file || echo BAD: file 78test ! -L file && test -f file || echo BAD: file
79test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 79test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
80test ! -e cp.testdir2/dir || echo BAD: dir 80test ! -L dir && test ! -e dir || echo BAD: dir
81test ! -e cp.testdir2/dir_symlink || echo BAD: dir_symlink 81test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink
82' "\ 82' "\
83cp: omitting directory ${sq}dir' 83cp: omitting directory ${sq}dir'
84cp: omitting directory ${sq}dir_symlink' 84cp: omitting directory ${sq}dir_symlink'
@@ -87,52 +87,52 @@ cp: omitting directory ${sq}dir_symlink'
87 87
88rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 88rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
89testing "cp -R" '\ 89testing "cp -R" '\
90cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 90cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
91test ! -L cp.testdir2/file || echo BAD: file 91test ! -L file && test -f file || echo BAD: file
92test -L cp.testdir2/file_symlink || echo BAD: file_symlink 92test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
93test ! -L cp.testdir2/dir || echo BAD: dir 93test ! -L dir && test -d dir || echo BAD: dir
94test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 94test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
95test ! -L cp.testdir2/dir/file || echo BAD: dir/file 95test ! -L dir/file && test -f dir/file || echo BAD: dir/file
96test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 96test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
97' "\ 97' "\
980 980
99" "" "" 99" "" ""
100 100
101rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 101rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
102testing "cp -Rd" '\ 102testing "cp -Rd" '\
103cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 103cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
104test ! -L cp.testdir2/file || echo BAD: file 104test ! -L file && test -f file || echo BAD: file
105test -L cp.testdir2/file_symlink || echo BAD: file_symlink 105test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
106test ! -L cp.testdir2/dir || echo BAD: dir 106test ! -L dir && test -d dir || echo BAD: dir
107test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 107test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
108test ! -L cp.testdir2/dir/file || echo BAD: dir/file 108test ! -L dir/file && test -f dir/file || echo BAD: dir/file
109test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 109test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
110' "\ 110' "\
1110 1110
112" "" "" 112" "" ""
113 113
114rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 114rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
115testing "cp -RP" '\ 115testing "cp -RP" '\
116cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 116cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
117test ! -L cp.testdir2/file || echo BAD: file 117test ! -L file && test -f file || echo BAD: file
118test -L cp.testdir2/file_symlink || echo BAD: file_symlink 118test -L file_symlink && test -f file_symlink || echo BAD: file_symlink
119test ! -L cp.testdir2/dir || echo BAD: dir 119test ! -L dir && test -d dir || echo BAD: dir
120test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 120test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
121test ! -L cp.testdir2/dir/file || echo BAD: dir/file 121test ! -L dir/file && test -f dir/file || echo BAD: dir/file
122test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 122test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
123' "\ 123' "\
1240 1240
125" "" "" 125" "" ""
126 126
127rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 127rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
128testing "cp -RL" '\ 128testing "cp -RL" '\
129cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 129cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
130test ! -L cp.testdir2/file || echo BAD: file 130test ! -L file && test -f file || echo BAD: file
131test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 131test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
132test ! -L cp.testdir2/dir || echo BAD: dir 132test ! -L dir && test -d dir || echo BAD: dir
133test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 133test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
134test ! -L cp.testdir2/dir/file || echo BAD: dir/file 134test ! -L dir/file && test -f dir/file || echo BAD: dir/file
135test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 135test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
136' "\ 136' "\
1370 1370
138" "" "" 138" "" ""
@@ -142,13 +142,13 @@ rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
142# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir' 142# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
143test x"$SKIP_KNOWN_BUGS" = x"" && \ 143test x"$SKIP_KNOWN_BUGS" = x"" && \
144testing "cp -RH" '\ 144testing "cp -RH" '\
145cd cp.testdir || exit 1; cp -RH * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 145cd cp.testdir || exit 1; cp -RH * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
146test ! -L cp.testdir2/file || echo BAD: file 146test ! -L file && test -f file || echo BAD: file
147test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 147test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
148test ! -L cp.testdir2/dir || echo BAD: dir 148test ! -L dir && test -d dir || echo BAD: dir
149test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 149test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
150test ! -L cp.testdir2/dir/file || echo BAD: dir/file 150test ! -L dir/file && test -f dir/file || echo BAD: dir/file
151test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 151test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
152' "\ 152' "\
1530 1530
154" "" "" 154" "" ""
@@ -158,26 +158,26 @@ rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
158# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir' 158# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
159test x"$SKIP_KNOWN_BUGS" = x"" && \ 159test x"$SKIP_KNOWN_BUGS" = x"" && \
160testing "cp -RHP" '\ 160testing "cp -RHP" '\
161cd cp.testdir || exit 1; cp -RHP * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 161cd cp.testdir || exit 1; cp -RHP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
162test ! -L cp.testdir2/file || echo BAD: file 162test ! -L file && test -f file || echo BAD: file
163test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 163test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
164test ! -L cp.testdir2/dir || echo BAD: dir 164test ! -L dir && test -d dir || echo BAD: dir
165test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 165test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
166test ! -L cp.testdir2/dir/file || echo BAD: dir/file 166test ! -L dir/file && test -f dir/file || echo BAD: dir/file
167test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 167test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
168' "\ 168' "\
1690 1690
170" "" "" 170" "" ""
171 171
172rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 172rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
173testing "cp -RHL" '\ 173testing "cp -RHL" '\
174cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 174cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
175test ! -L cp.testdir2/file || echo BAD: file 175test ! -L file && test -f file || echo BAD: file
176test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 176test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
177test ! -L cp.testdir2/dir || echo BAD: dir 177test ! -L dir && test -d dir || echo BAD: dir
178test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 178test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
179test ! -L cp.testdir2/dir/file || echo BAD: dir/file 179test ! -L dir/file && test -f dir/file || echo BAD: dir/file
180test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 180test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
181' "\ 181' "\
1820 1820
183" "" "" 183" "" ""
@@ -188,13 +188,13 @@ rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1
188# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir' 188# cp: will not create hard link `../cp.testdir2/dir_symlink' to directory `../cp.testdir2/dir'
189test x"$SKIP_KNOWN_BUGS" = x"" && \ 189test x"$SKIP_KNOWN_BUGS" = x"" && \
190testing "cp -RLH" '\ 190testing "cp -RLH" '\
191cd cp.testdir || exit 1; cp -RLH * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 191cd cp.testdir || exit 1; cp -RLH * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1
192test ! -L cp.testdir2/file || echo BAD: file 192test ! -L file && test -f file || echo BAD: file
193test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink 193test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink
194test ! -L cp.testdir2/dir || echo BAD: dir 194test ! -L dir && test -d dir || echo BAD: dir
195test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink 195test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink
196test ! -L cp.testdir2/dir/file || echo BAD: dir/file 196test ! -L dir/file && test -f dir/file || echo BAD: dir/file
197test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink 197test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink
198' "\ 198' "\
1990 1990
200" "" "" 200" "" ""