diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-16 02:27:31 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-16 02:27:31 +0100 |
commit | 1e9bc2603dc6c9dc282058056e1c28bd817da488 (patch) | |
tree | 81387ab572370062665654b26231b68711e53e07 | |
parent | d084cb9dc70bfe4a56c2b4b83801ef8d991725f4 (diff) | |
download | busybox-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-x | testsuite/cp.tests | 162 |
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 | ||
25 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 25 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
26 | testing "cp" '\ | 26 | testing "cp" '\ |
27 | cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 27 | cd cp.testdir || exit 1; cp * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
28 | test ! -L cp.testdir2/file || echo BAD: file | 28 | test ! -L file && test -f file || echo BAD: file |
29 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 29 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
30 | test ! -e cp.testdir2/dir || echo BAD: dir | 30 | test ! -L dir && test ! -e dir || echo BAD: dir |
31 | test ! -e cp.testdir2/dir_symlink || echo BAD: dir_symlink | 31 | test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink |
32 | ' "\ | 32 | ' "\ |
33 | cp: omitting directory ${sq}dir' | 33 | cp: omitting directory ${sq}dir' |
34 | cp: omitting directory ${sq}dir_symlink' | 34 | cp: omitting directory ${sq}dir_symlink' |
@@ -37,11 +37,11 @@ cp: omitting directory ${sq}dir_symlink' | |||
37 | 37 | ||
38 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 38 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
39 | testing "cp -d" '\ | 39 | testing "cp -d" '\ |
40 | cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 40 | cd cp.testdir || exit 1; cp -d * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
41 | test ! -L cp.testdir2/file || echo BAD: file | 41 | test ! -L file && test -f file || echo BAD: file |
42 | test -L cp.testdir2/file_symlink || echo BAD: file_symlink | 42 | test -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
43 | test ! -e cp.testdir2/dir || echo BAD: dir | 43 | test ! -L dir && test ! -e dir || echo BAD: dir |
44 | test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 44 | test -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink |
45 | ' "\ | 45 | ' "\ |
46 | cp: omitting directory ${sq}dir' | 46 | cp: omitting directory ${sq}dir' |
47 | 1 | 47 | 1 |
@@ -49,11 +49,11 @@ cp: omitting directory ${sq}dir' | |||
49 | 49 | ||
50 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 50 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
51 | testing "cp -P" '\ | 51 | testing "cp -P" '\ |
52 | cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 52 | cd cp.testdir || exit 1; cp -P * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
53 | test ! -L cp.testdir2/file || echo BAD: file | 53 | test ! -L file && test -f file || echo BAD: file |
54 | test -L cp.testdir2/file_symlink || echo BAD: file_symlink | 54 | test -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
55 | test ! -e cp.testdir2/dir || echo BAD: dir | 55 | test ! -L dir && test ! -e dir || echo BAD: dir |
56 | test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 56 | test -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink |
57 | ' "\ | 57 | ' "\ |
58 | cp: omitting directory ${sq}dir' | 58 | cp: omitting directory ${sq}dir' |
59 | 1 | 59 | 1 |
@@ -61,11 +61,11 @@ cp: omitting directory ${sq}dir' | |||
61 | 61 | ||
62 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 62 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
63 | testing "cp -L" '\ | 63 | testing "cp -L" '\ |
64 | cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 64 | cd cp.testdir || exit 1; cp -L * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
65 | test ! -L cp.testdir2/file || echo BAD: file | 65 | test ! -L file && test -f file || echo BAD: file |
66 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 66 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
67 | test ! -e cp.testdir2/dir || echo BAD: dir | 67 | test ! -L dir && test ! -e dir || echo BAD: dir |
68 | test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 68 | test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink |
69 | ' "\ | 69 | ' "\ |
70 | cp: omitting directory ${sq}dir' | 70 | cp: omitting directory ${sq}dir' |
71 | cp: omitting directory ${sq}dir_symlink' | 71 | cp: omitting directory ${sq}dir_symlink' |
@@ -74,11 +74,11 @@ cp: omitting directory ${sq}dir_symlink' | |||
74 | 74 | ||
75 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 75 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
76 | testing "cp -H" '\ | 76 | testing "cp -H" '\ |
77 | cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 77 | cd cp.testdir || exit 1; cp -H * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
78 | test ! -L cp.testdir2/file || echo BAD: file | 78 | test ! -L file && test -f file || echo BAD: file |
79 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 79 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
80 | test ! -e cp.testdir2/dir || echo BAD: dir | 80 | test ! -L dir && test ! -e dir || echo BAD: dir |
81 | test ! -e cp.testdir2/dir_symlink || echo BAD: dir_symlink | 81 | test ! -L dir_symlink && test ! -e dir_symlink || echo BAD: dir_symlink |
82 | ' "\ | 82 | ' "\ |
83 | cp: omitting directory ${sq}dir' | 83 | cp: omitting directory ${sq}dir' |
84 | cp: omitting directory ${sq}dir_symlink' | 84 | cp: omitting directory ${sq}dir_symlink' |
@@ -87,52 +87,52 @@ cp: omitting directory ${sq}dir_symlink' | |||
87 | 87 | ||
88 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 88 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
89 | testing "cp -R" '\ | 89 | testing "cp -R" '\ |
90 | cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 90 | cd cp.testdir || exit 1; cp -R * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
91 | test ! -L cp.testdir2/file || echo BAD: file | 91 | test ! -L file && test -f file || echo BAD: file |
92 | test -L cp.testdir2/file_symlink || echo BAD: file_symlink | 92 | test -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
93 | test ! -L cp.testdir2/dir || echo BAD: dir | 93 | test ! -L dir && test -d dir || echo BAD: dir |
94 | test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 94 | test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
95 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 95 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
96 | test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 96 | test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
97 | ' "\ | 97 | ' "\ |
98 | 0 | 98 | 0 |
99 | " "" "" | 99 | " "" "" |
100 | 100 | ||
101 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 101 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
102 | testing "cp -Rd" '\ | 102 | testing "cp -Rd" '\ |
103 | cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 103 | cd cp.testdir || exit 1; cp -Rd * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
104 | test ! -L cp.testdir2/file || echo BAD: file | 104 | test ! -L file && test -f file || echo BAD: file |
105 | test -L cp.testdir2/file_symlink || echo BAD: file_symlink | 105 | test -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
106 | test ! -L cp.testdir2/dir || echo BAD: dir | 106 | test ! -L dir && test -d dir || echo BAD: dir |
107 | test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 107 | test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
108 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 108 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
109 | test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 109 | test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
110 | ' "\ | 110 | ' "\ |
111 | 0 | 111 | 0 |
112 | " "" "" | 112 | " "" "" |
113 | 113 | ||
114 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 114 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
115 | testing "cp -RP" '\ | 115 | testing "cp -RP" '\ |
116 | cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 116 | cd cp.testdir || exit 1; cp -RP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
117 | test ! -L cp.testdir2/file || echo BAD: file | 117 | test ! -L file && test -f file || echo BAD: file |
118 | test -L cp.testdir2/file_symlink || echo BAD: file_symlink | 118 | test -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
119 | test ! -L cp.testdir2/dir || echo BAD: dir | 119 | test ! -L dir && test -d dir || echo BAD: dir |
120 | test -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 120 | test -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
121 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 121 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
122 | test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 122 | test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
123 | ' "\ | 123 | ' "\ |
124 | 0 | 124 | 0 |
125 | " "" "" | 125 | " "" "" |
126 | 126 | ||
127 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 127 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
128 | testing "cp -RL" '\ | 128 | testing "cp -RL" '\ |
129 | cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 129 | cd cp.testdir || exit 1; cp -RL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
130 | test ! -L cp.testdir2/file || echo BAD: file | 130 | test ! -L file && test -f file || echo BAD: file |
131 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 131 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
132 | test ! -L cp.testdir2/dir || echo BAD: dir | 132 | test ! -L dir && test -d dir || echo BAD: dir |
133 | test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 133 | test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
134 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 134 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
135 | test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 135 | test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
136 | ' "\ | 136 | ' "\ |
137 | 0 | 137 | 0 |
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' |
143 | test x"$SKIP_KNOWN_BUGS" = x"" && \ | 143 | test x"$SKIP_KNOWN_BUGS" = x"" && \ |
144 | testing "cp -RH" '\ | 144 | testing "cp -RH" '\ |
145 | cd cp.testdir || exit 1; cp -RH * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 145 | cd cp.testdir || exit 1; cp -RH * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
146 | test ! -L cp.testdir2/file || echo BAD: file | 146 | test ! -L file && test -f file || echo BAD: file |
147 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 147 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
148 | test ! -L cp.testdir2/dir || echo BAD: dir | 148 | test ! -L dir && test -d dir || echo BAD: dir |
149 | test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 149 | test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
150 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 150 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
151 | test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 151 | test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
152 | ' "\ | 152 | ' "\ |
153 | 0 | 153 | 0 |
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' |
159 | test x"$SKIP_KNOWN_BUGS" = x"" && \ | 159 | test x"$SKIP_KNOWN_BUGS" = x"" && \ |
160 | testing "cp -RHP" '\ | 160 | testing "cp -RHP" '\ |
161 | cd cp.testdir || exit 1; cp -RHP * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 161 | cd cp.testdir || exit 1; cp -RHP * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
162 | test ! -L cp.testdir2/file || echo BAD: file | 162 | test ! -L file && test -f file || echo BAD: file |
163 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 163 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
164 | test ! -L cp.testdir2/dir || echo BAD: dir | 164 | test ! -L dir && test -d dir || echo BAD: dir |
165 | test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 165 | test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
166 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 166 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
167 | test -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 167 | test -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
168 | ' "\ | 168 | ' "\ |
169 | 0 | 169 | 0 |
170 | " "" "" | 170 | " "" "" |
171 | 171 | ||
172 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 | 172 | rm -rf cp.testdir2 >/dev/null && mkdir cp.testdir2 || exit 1 |
173 | testing "cp -RHL" '\ | 173 | testing "cp -RHL" '\ |
174 | cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 174 | cd cp.testdir || exit 1; cp -RHL * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
175 | test ! -L cp.testdir2/file || echo BAD: file | 175 | test ! -L file && test -f file || echo BAD: file |
176 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 176 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
177 | test ! -L cp.testdir2/dir || echo BAD: dir | 177 | test ! -L dir && test -d dir || echo BAD: dir |
178 | test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 178 | test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
179 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 179 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
180 | test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 180 | test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
181 | ' "\ | 181 | ' "\ |
182 | 0 | 182 | 0 |
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' |
189 | test x"$SKIP_KNOWN_BUGS" = x"" && \ | 189 | test x"$SKIP_KNOWN_BUGS" = x"" && \ |
190 | testing "cp -RLH" '\ | 190 | testing "cp -RLH" '\ |
191 | cd cp.testdir || exit 1; cp -RLH * ../cp.testdir2 2>&1; echo $?; cd .. || exit 1 | 191 | cd cp.testdir || exit 1; cp -RLH * ../cp.testdir2 2>&1; echo $?; cd ../cp.testdir2 || exit 1 |
192 | test ! -L cp.testdir2/file || echo BAD: file | 192 | test ! -L file && test -f file || echo BAD: file |
193 | test ! -L cp.testdir2/file_symlink || echo BAD: file_symlink | 193 | test ! -L file_symlink && test -f file_symlink || echo BAD: file_symlink |
194 | test ! -L cp.testdir2/dir || echo BAD: dir | 194 | test ! -L dir && test -d dir || echo BAD: dir |
195 | test ! -L cp.testdir2/dir_symlink || echo BAD: dir_symlink | 195 | test ! -L dir_symlink && test -d dir_symlink || echo BAD: dir_symlink |
196 | test ! -L cp.testdir2/dir/file || echo BAD: dir/file | 196 | test ! -L dir/file && test -f dir/file || echo BAD: dir/file |
197 | test ! -L cp.testdir2/dir/file_symlink || echo BAD: dir/file_symlink | 197 | test ! -L dir/file_symlink && test -f dir/file_symlink || echo BAD: dir/file_symlink |
198 | ' "\ | 198 | ' "\ |
199 | 0 | 199 | 0 |
200 | " "" "" | 200 | " "" "" |