aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorerik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-02-07 05:29:42 +0000
committererik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-02-07 05:29:42 +0000
commit74bc01e03e96d5a6a318688d2ee8c620f32ce928 (patch)
treedccf8f905fc5807239883da9fca6597037d487fc /tests
parentcac2faf4271a09ae2e37e87cbd7d6ea363667d51 (diff)
downloadbusybox-w32-74bc01e03e96d5a6a318688d2ee8c620f32ce928.tar.gz
busybox-w32-74bc01e03e96d5a6a318688d2ee8c620f32ce928.tar.bz2
busybox-w32-74bc01e03e96d5a6a318688d2ee8c620f32ce928.zip
A few minor updates. ;-)
Seriously though, read the Changelog for busybox 0.42, which this is about to become... -Erik git-svn-id: svn://busybox.net/trunk/busybox@351 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile28
-rw-r--r--tests/cp_tests.mk270
-rw-r--r--tests/ln_tests.mk66
-rw-r--r--tests/mv_tests.mk137
4 files changed, 501 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 000000000..015634460
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,28 @@
1all test_all: message_header cp_tests mv_tests ln_tests
2
3clean: cp_clean mv_clean ln_clean
4
5message_header:
6 @echo
7 @echo If tests faile due to differences in timestamps in commands that are not set
8 @echo to preserve timestamps, just run the tests again.
9 @echo
10
11include cp_tests.mk
12include mv_tests.mk
13include ln_tests.mk
14
15BBL := $(shell pushd .. >/dev/null && \
16 ${MAKE} busybox.links >/dev/null && \
17 popd >/dev/null && \
18 cat ../busybox.links | \
19 sed -e 's,.*/\(.*\)$$,\1,')
20
21../busybox:
22 cd .. && ${MAKE} busybox
23
24$(BBL): ../busybox
25 rm -f $@
26 ln ../busybox $@
27
28.PHONY: all test_all message_header
diff --git a/tests/cp_tests.mk b/tests/cp_tests.mk
new file mode 100644
index 000000000..e14262ac1
--- /dev/null
+++ b/tests/cp_tests.mk
@@ -0,0 +1,270 @@
1# This is a -*- makefile -*-
2
3# GNU `cp'
4GCP = /bin/cp
5# BusyBox `cp'
6BCP = $(shell pwd)/cp
7
8.PHONY: cp_clean
9cp_clean:
10 rm -rf cp_tests cp_*.{gnu,bb} cp
11
12.PHONY: cp_tests
13cp_tests: cp_clean cp
14 @echo;
15 @echo "No output from diff means busybox cp is functioning properly.";
16
17 @echo;
18 ${BCP} || true;
19
20 @echo;
21 mkdir cp_tests;
22
23 @echo;
24 cd cp_tests; \
25 echo A file > afile; \
26 ls -l afile > ../cp_afile_afilecopy.gnu; \
27 ${GCP} afile afilecopy; \
28 ls -l afile afilecopy >> ../cp_afile_afilecopy.gnu;
29
30 @echo;
31 rm -f cp_tests/afile*;
32
33 @echo;
34 cd cp_tests; \
35 echo A file > afile; \
36 ls -l afile > ../cp_afile_afilecopy.bb; \
37 ${BCP} afile afilecopy; \
38 ls -l afile afilecopy >> ../cp_afile_afilecopy.bb;
39
40 @echo;
41 diff -u cp_afile_afilecopy.gnu cp_afile_afilecopy.bb;
42
43 @echo;
44 rm -f cp_tests/afile*;
45
46 @echo; echo;
47 cd cp_tests; \
48 mkdir there there1; \
49 cd there; \
50 ln -s ../afile .;
51
52 @echo;
53 cd cp_tests; \
54 echo A file > afile; \
55 ls -l afile > ../cp_symlink.gnu; \
56 ${GCP} there/afile there1/; \
57 ls -l afile there/afile there1/afile >> ../cp_symlink.gnu;
58
59 @echo;
60 rm -f cp_tests/afile cp_tests/there1/afile;
61
62 @echo;
63 cd cp_tests; \
64 echo A file > afile; \
65 ls -l afile > ../cp_symlink.bb; \
66 ${BCP} there/afile there1/; \
67 ls -l afile there/afile there1/afile >> ../cp_symlink.bb;
68
69 @echo;
70 diff -u cp_symlink.gnu cp_symlink.bb;
71
72 @echo;
73 rm -f cp_tests/afile cp_tests/there1/afile;
74
75 @echo; echo;
76 cd cp_tests; \
77 echo A file > afile; \
78 ls -l afile > ../cp_a_symlink.gnu; \
79 ${GCP} -a there/afile there1/; \
80 ls -l afile there/afile there1/afile >> ../cp_a_symlink.gnu;
81
82 @echo;
83 rm -f cp_tests/afile cp_tests/there1/afile;
84
85 @echo;
86 cd cp_tests; \
87 echo A file > afile; \
88 ls -l afile > ../cp_a_symlink.bb; \
89 ${BCP} -a there/afile there1/; \
90 ls -l afile there/afile there1/afile >> ../cp_a_symlink.bb;
91
92 @echo;
93 diff -u cp_a_symlink.gnu cp_a_symlink.bb;
94
95 @echo;
96 rm -f cp_tests/afile
97 rm -rf cp_tests/there{,1};
98
99 @echo; echo;
100 cd cp_tests; \
101 echo A file > there/afile; \
102 mkdir there/adir; \
103 touch there/adir/afileinadir; \
104 ln -s $(shell pwd) there/alink;
105
106 @echo;
107 cd cp_tests; \
108 ${GCP} -a there/ there1/; \
109 ls -lR there/ there1/ > ../cp_a_dir_dir.gnu;
110
111 @echo;
112 rm -rf cp_tests/there1;
113
114 @echo;
115 cd cp_tests; \
116 ${BCP} -a there/ there1/; \
117 ls -lR there/ there1/ > ../cp_a_dir_dir.bb;
118
119 @echo;
120 diff -u cp_a_dir_dir.gnu cp_a_dir_dir.bb;
121
122 @echo;
123 rm -rf cp_tests/there1/;
124
125 @echo; echo;
126 cd cp_tests; \
127 echo A file number one > afile1; \
128 echo A file number two, blah. > afile2; \
129 ln -s afile1 symlink1; \
130 mkdir there1; \
131 ${GCP} afile1 afile2 symlink1 there1/; \
132 ls -lR > ../cp_files_dir.gnu;
133
134 @echo;
135 rm -rf cp_tests/{afile{1,2},symlink1,there1};
136
137 @echo;
138 cd cp_tests; \
139 echo A file number one > afile1; \
140 echo A file number two, blah. > afile2; \
141 ln -s afile1 symlink1; \
142 mkdir there1; \
143 ${BCP} afile1 afile2 symlink1 there1/; \
144 ls -lR > ../cp_files_dir.bb;
145
146 @echo;
147 diff -u cp_files_dir.gnu cp_files_dir.bb;
148
149 @echo;
150 rm -rf cp_tests/{afile{1,2},symlink1,there1};
151
152 @echo; echo;
153 cd cp_tests; \
154 echo A file number one > afile1; \
155 echo A file number two, blah. > afile2; \
156 ln -s afile1 symlink1; \
157 mkdir there1; \
158 ${GCP} -d afile1 afile2 symlink1 there1/; \
159 ls -lR > ../cp_d_files_dir.gnu;
160
161 @echo;
162 rm -rf cp_tests/{afile{1,2},symlink1,there1};
163
164 @echo;
165 cd cp_tests; \
166 echo A file number one > afile1; \
167 echo A file number two, blah. > afile2; \
168 ln -s afile1 symlink1; \
169 mkdir there1; \
170 ${BCP} -d afile1 afile2 symlink1 there1/; \
171 ls -lR > ../cp_d_files_dir.bb;
172
173 @echo;
174 diff -u cp_d_files_dir.gnu cp_d_files_dir.bb;
175
176 @echo;
177 rm -rf cp_tests/{afile{1,2},symlink1,there1};
178
179 @echo; echo;
180 cd cp_tests; \
181 echo A file number one > afile1; \
182 echo A file number two, blah. > afile2; \
183 touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \
184 ln -s afile1 symlink1; \
185 mkdir there1; \
186 ${GCP} -p afile1 afile2 symlink1 there1/; \
187 ls -lR > ../cp_p_files_dir.gnu;
188
189 @echo;
190 rm -rf cp_tests/{afile{1,2},symlink1,there1};
191
192 @echo;
193 cd cp_tests; \
194 echo A file number one > afile1; \
195 echo A file number two, blah. > afile2; \
196 touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \
197 ln -s afile1 symlink1; \
198 mkdir there1; \
199 ${BCP} -p afile1 afile2 symlink1 there1/; \
200 ls -lR > ../cp_p_files_dir.bb;
201
202 @echo;
203 diff -u cp_p_files_dir.gnu cp_p_files_dir.bb;
204
205 @echo;
206 rm -rf cp_tests/{afile{1,2},symlink1,there1};
207
208 @echo; echo;
209 cd cp_tests; \
210 echo A file number one > afile1; \
211 echo A file number two, blah. > afile2; \
212 touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \
213 ln -s afile1 symlink1; \
214 mkdir there1; \
215 ${GCP} -p -d afile1 afile2 symlink1 there1/; \
216 ls -lR > ../cp_pd_files_dir.gnu;
217
218 @echo;
219 rm -rf cp_tests/{afile{1,2},symlink1,there1};
220
221 @echo;
222 cd cp_tests; \
223 echo A file number one > afile1; \
224 echo A file number two, blah. > afile2; \
225 touch --date='Sat Jan 29 21:24:08 PST 2000' afile1; \
226 ln -s afile1 symlink1; \
227 mkdir there1; \
228 ${BCP} -p -d afile1 afile2 symlink1 there1/; \
229 ls -lR > ../cp_pd_files_dir.bb;
230
231 @echo;
232 diff -u cp_pd_files_dir.gnu cp_pd_files_dir.bb;
233
234 @echo;
235 rm -rf cp_tests/{afile{1,2},symlink1,there1};
236
237 @echo; echo;
238 cd cp_tests; \
239 mkdir dir{a,b}; \
240 echo A file > dira/afile; \
241 echo A file in dirb > dirb/afileindirb; \
242 ln -s dira/afile dira/alinktoafile; \
243 mkdir dira/subdir1; \
244 echo Another file > dira/subdir1/anotherfile; \
245 ls -lR . > ../cp_a_dira_dirb.gnu; \
246 ${GCP} -a dira dirb; \
247 ls -lR . >> ../cp_a_dira_dirb.gnu;
248
249 # false;
250 @echo;
251 rm -rf cp_tests/dir{a,b};
252
253 @echo;
254 cd cp_tests; \
255 mkdir dir{a,b}; \
256 echo A file > dira/afile; \
257 echo A file in dirb > dirb/afileindirb; \
258 ln -s dira/afile dira/alinktoafile; \
259 mkdir dira/subdir1; \
260 echo Another file > dira/subdir1/anotherfile; \
261 ls -lR . > ../cp_a_dira_dirb.bb; \
262 ${BCP} -a dira dirb; \
263 ls -lR . >> ../cp_a_dira_dirb.bb;
264
265 @echo;
266 diff -u cp_a_dira_dirb.gnu cp_a_dira_dirb.bb;
267
268 # false;
269 @echo;
270 rm -rf cp_tests/dir{a,b};
diff --git a/tests/ln_tests.mk b/tests/ln_tests.mk
new file mode 100644
index 000000000..5925edd4f
--- /dev/null
+++ b/tests/ln_tests.mk
@@ -0,0 +1,66 @@
1
2# GNU `ln'
3GLN = /bin/ln
4# BusyBox `ln'
5BLN = $(shell pwd)/ln
6
7.PHONY: ln_clean
8ln_clean:
9 rm -rf ln_tests ln_*.{gnu,bb} ln
10
11.PHONY: ln_tests
12ln_tests: ln_clean ln
13 @echo;
14 @echo "No output from diff means busybox ln is functioning properly.";
15
16 @echo;
17 ${BLN} || true;
18
19 @echo;
20 mkdir ln_tests;
21
22 @echo;
23 cd ln_tests; \
24 echo A file > afile; \
25 ls -l afile > ../ln_afile_newname.gnu; \
26 ${GLN} afile newname; \
27 ls -l afile newname >> ../ln_afile_newname.gnu;
28
29 @echo;
30 rm -f ln_tests/{afile,newname};
31
32 @echo;
33 cd ln_tests; \
34 echo A file > afile; \
35 ls -l afile > ../ln_afile_newname.bb; \
36 ${BLN} afile newname; \
37 ls -l afile newname >> ../ln_afile_newname.bb;
38
39 @echo;
40 diff -u ln_afile_newname.gnu ln_afile_newname.bb
41
42 @echo;
43 rm -f ln_tests/{afile,newname};
44
45 @echo;
46 cd ln_tests; \
47 echo A file > afile; \
48 ls -l afile > ../ln_s_afile_newname.gnu; \
49 ${GLN} -s afile newname; \
50 ls -l afile newname >> ../ln_s_afile_newname.gnu;
51
52 @echo;
53 rm -f ln_tests/{afile,newname};
54
55 @echo;
56 cd ln_tests; \
57 echo A file > afile; \
58 ls -l afile > ../ln_s_afile_newname.bb; \
59 ${BLN} -s afile newname; \
60 ls -l afile newname >> ../ln_s_afile_newname.bb;
61
62 @echo;
63 diff -u ln_s_afile_newname.gnu ln_s_afile_newname.bb
64
65 @echo;
66 rm -f ln_tests/{afile,newname};
diff --git a/tests/mv_tests.mk b/tests/mv_tests.mk
new file mode 100644
index 000000000..3a9012538
--- /dev/null
+++ b/tests/mv_tests.mk
@@ -0,0 +1,137 @@
1
2# GNU `mv'
3GMV = /bin/mv
4# BusyBox `mv'
5BMV = $(shell pwd)/mv
6
7.PHONY: mv_clean
8mv_clean:
9 rm -rf mv_tests mv_*.{gnu,bb} mv
10
11.PHONY: mv_tests
12mv_tests: mv_clean mv
13 @echo;
14 @echo "No output from diff means busybox mv is functioning properly.";
15 @echo;
16 @echo "No such file or directory is good; it means the old file got removed.";
17 @echo;
18 ${BMV} || true;
19
20 @echo;
21 mkdir mv_tests;
22
23 @echo;
24 cd mv_tests; \
25 echo A file > afile; \
26 ls -l afile > ../mv_afile_newname.gnu; \
27 ${GMV} afile newname; \
28 ls -l newname >> ../mv_afile_newname.gnu;
29 -ls -l mv_tests/afile;
30
31 @echo;
32 rm -f mv_tests/{afile,newname};
33
34 @echo;
35 cd mv_tests; \
36 echo A file > afile; \
37 ls -l afile > ../mv_afile_newname.bb; \
38 ${BMV} afile newname; \
39 ls -l newname >> ../mv_afile_newname.bb;
40 -ls -l mv_tests/afile;
41
42 @echo;
43 diff -u mv_afile_newname.gnu mv_afile_newname.bb;
44
45 @echo;
46 rm -f mv_tests/{afile,newname};
47
48 @echo; echo;
49 cd mv_tests; \
50 echo A file > afile; \
51 ln -s afile symlink; \
52 ls -l afile symlink > ../mv_symlink_newname.gnu; \
53 ${GMV} symlink newname; \
54 ls -l afile newname >> ../mv_symlink_newname.gnu;
55 -ls -l mv_tests/symlink;
56
57 @echo;
58 rm -f mv_tests/{afile,newname};
59
60 @echo;
61 cd mv_tests; \
62 echo A file > afile; \
63 ln -s afile symlink; \
64 ls -l afile symlink > ../mv_symlink_newname.bb;\
65 ${BMV} symlink newname; \
66 ls -l afile newname >> ../mv_symlink_newname.bb;
67 -ls -l mv_tests/symlink;
68
69 @echo;
70 diff -u mv_symlink_newname.gnu mv_symlink_newname.bb;
71
72 @echo;
73 rm -rf mv_tests/*;
74
75 @echo; echo;
76 cd mv_tests; \
77 echo A file > afile; \
78 ln -s afile symlink; \
79 mkdir newdir; \
80 ls -lR > ../mv_file_symlink_dir.gnu; \
81 ${GMV} symlink afile newdir; \
82 ls -lR >> ../mv_file_symlink_dir.gnu;
83 -ls -l mv_tests/{symlink,afile};
84
85 @echo;
86 rm -rf mv_tests/*
87
88 @echo; echo;
89 cd mv_tests; \
90 echo A file > afile; \
91 ln -s afile symlink; \
92 mkdir newdir; \
93 ls -lR > ../mv_file_symlink_dir.bb; \
94 ${BMV} symlink afile newdir; \
95 ls -lR >> ../mv_file_symlink_dir.bb;
96 -ls -l mv_tests/{symlink,afile};
97
98 @echo;
99 diff -u mv_file_symlink_dir.gnu mv_file_symlink_dir.bb;
100
101 @echo;
102 rm -rf mv_tests/*;
103
104 @echo; echo;
105 cd mv_tests; \
106 mkdir dir{a,b}; \
107 echo A file > dira/afile; \
108 echo A file in dirb > dirb/afileindirb; \
109 ln -s dira/afile dira/alinktoafile; \
110 mkdir dira/subdir1; \
111 echo Another file > dira/subdir1/anotherfile; \
112 ls -lR . > ../mv_dira_dirb.gnu; \
113 ${GMV} dira dirb; \
114 ls -lR . >> ../mv_dira_dirb.gnu;
115
116 # false;
117 @echo;
118 rm -rf mv_tests/dir{a,b};
119
120 @echo;
121 cd mv_tests; \
122 mkdir dir{a,b}; \
123 echo A file > dira/afile; \
124 echo A file in dirb > dirb/afileindirb; \
125 ln -s dira/afile dira/alinktoafile; \
126 mkdir dira/subdir1; \
127 echo Another file > dira/subdir1/anotherfile; \
128 ls -lR . > ../mv_dira_dirb.bb; \
129 ${BMV} dira dirb; \
130 ls -lR . >> ../mv_dira_dirb.bb;
131
132 @echo;
133 diff -u mv_dira_dirb.gnu mv_dira_dirb.bb;
134
135 # false;
136 @echo;
137 rm -rf mv_tests/dir{a,b};